diff --git a/haproxy-mixin/build-image.nix b/haproxy-mixin/build-image.nix index d9208e257..f557463a9 100644 --- a/haproxy-mixin/build-image.nix +++ b/haproxy-mixin/build-image.nix @@ -1,6 +1,9 @@ -{ pkgs ? import }: +{ + pkgs ? import , +}: -let common = import ./common.nix { inherit pkgs; }; +let + common = import ./common.nix { inherit pkgs; }; in with pkgs; dockerTools.buildImage { diff --git a/haproxy-mixin/common.nix b/haproxy-mixin/common.nix index b842ef035..5bad147b2 100644 --- a/haproxy-mixin/common.nix +++ b/haproxy-mixin/common.nix @@ -1,9 +1,14 @@ -{ pkgs ? import }: +{ + pkgs ? import , +}: with pkgs; { # devTools are packages specifically for development environments. - devTools = [ docker docker-compose ]; + devTools = [ + docker + docker-compose + ]; # buildTools are packages needed for dev and CI builds. buildTools = [ bash diff --git a/haproxy-mixin/flake.lock b/haproxy-mixin/flake.lock index 348ba021d..ff02682f9 100644 --- a/haproxy-mixin/flake.lock +++ b/haproxy-mixin/flake.lock @@ -1,12 +1,15 @@ { "nodes": { "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1631561581, - "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -17,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1634436779, - "narHash": "sha256-D/nrXTWpe1bPIjFy85sgiLHYqu+AeaC6v5/+KlA9PRg=", + "lastModified": 1753429684, + "narHash": "sha256-9h7+4/53cSfQ/uA3pSvCaBepmZaz/dLlLVJnbQ+SJjk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9aeeb7574fb784eaf6395f4400705b5f619e6cc3", + "rev": "7fd36ee82c0275fb545775cc5e4d30542899511d", "type": "github" }, "original": { @@ -36,6 +39,21 @@ "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/haproxy-mixin/flake.nix b/haproxy-mixin/flake.nix index c37a53621..c6d1712d5 100644 --- a/haproxy-mixin/flake.nix +++ b/haproxy-mixin/flake.nix @@ -4,25 +4,34 @@ inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; inputs.flake-utils.url = "github:numtide/flake-utils"; - outputs = { self, nixpkgs, flake-utils }: + outputs = { - overlay = - (final: prev: { - jsonnet-bundler = prev.callPackage ./nix/jsonnet-bundler.nix { pkgs = prev; }; + self, + nixpkgs, + flake-utils, + }: + { + overlay = ( + final: prev: { mixtool = prev.callPackage ./nix/mixtool.nix { pkgs = prev; }; - }); - } // - (flake-utils.lib.eachDefaultSystem - (system: - let pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; }; - in - { - devShell = import ./shell.nix { - inherit pkgs; - }; - packages = { - haproxy-mixin-build-image = import ./build-image.nix { inherit pkgs; }; - }; } - )); + ); + } + // (flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ self.overlay ]; + }; + in + { + devShell = import ./shell.nix { + inherit pkgs; + }; + packages = { + haproxy-mixin-build-image = import ./build-image.nix { inherit pkgs; }; + }; + } + )); } diff --git a/haproxy-mixin/nix/jsonnet-bundler.nix b/haproxy-mixin/nix/jsonnet-bundler.nix deleted file mode 100644 index aaa96bbef..000000000 --- a/haproxy-mixin/nix/jsonnet-bundler.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs ? import }: - -with pkgs; -buildGoModule rec { - pname = "jsonnet-bundler"; - version = "0.4.0"; - - src = fetchFromGitHub { - owner = pname; - repo = pname; - rev = "v${version}"; - sha256 = "0pk6nf8r0wy7lnsnzyjd3vgq4b2kb3zl0xxn01ahpaqgmwpzajlk"; - }; - - subPackages = [ "cmd/jb" ]; - vendorSha256 = null; - - meta = with lib; { - description = "A Jsonnet package manager"; - license = licenses.asl20; - }; -} diff --git a/haproxy-mixin/nix/mixtool.nix b/haproxy-mixin/nix/mixtool.nix index 163e88cc1..513f03c39 100644 --- a/haproxy-mixin/nix/mixtool.nix +++ b/haproxy-mixin/nix/mixtool.nix @@ -1,22 +1,30 @@ -{ pkgs ? import }: +{ + pkgs ? import , +}: -with pkgs; -buildGoModule rec { +pkgs.buildGoModule (finalAttrs: { pname = "mixtool"; - version = "bd0efc3"; + version = "0-unstable-2025-07-07"; - src = fetchFromGitHub { + src = pkgs.fetchFromGitHub { owner = "monitoring-mixins"; - repo = pname; - rev = "${version}"; - sha256 = "1kh2axna553q7lrmgak8l7jlnmbdfkfci240bqa3040pd82j3q1c"; + repo = "mixtool"; + rev = "1abe34c3187d53b795d0474535b476bc9b7500c3"; + hash = "sha256-RRoz5Kp/IGkUD6XVK70+k4L05rYqhkqh6LpopihyEd8="; }; - subPackages = [ "cmd/mixtool" ]; - vendorSha256 = "10wvckrwrc7xs3dng9m6lznsaways2wycxnl9h8jynp4h2cw22ml"; + vendorHash = "sha256-o9HNcq7XHXH/s6UthYADsktGh9NjgC1rVPbGP11Cfc0="; - meta = with lib; { - description = "Helper for easily working with Jsonnet mixins"; - license = licenses.asl20; + ldflags = [ + "-s" + "-w" + ]; + + meta = { + description = "Helper for easily working with jsonnet mixins"; + homepage = "https://github.com/monitoring-mixins/mixtool"; + license = pkgs.lib.licenses.asl20; + maintainers = with pkgs.lib.maintainers; [ arikgrahl ]; + mainProgram = "mixtool"; }; -} +}) diff --git a/haproxy-mixin/shell.nix b/haproxy-mixin/shell.nix index e264bb146..bcb7f2a94 100644 --- a/haproxy-mixin/shell.nix +++ b/haproxy-mixin/shell.nix @@ -1,7 +1,10 @@ -{ pkgs ? import }: +{ + pkgs ? import , +}: with pkgs; -let common = import ./common.nix { inherit pkgs; }; +let + common = import ./common.nix { inherit pkgs; }; in mkShell { buildInputs = common.buildTools ++ common.devTools;