Skip to content

Commit da2e332

Browse files
authored
chore: update Nix tooling for HAProxy (#1467)
1 parent 6226b75 commit da2e332

File tree

7 files changed

+90
-66
lines changed

7 files changed

+90
-66
lines changed

haproxy-mixin/build-image.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
{ pkgs ? import <nixpkgs> }:
1+
{
2+
pkgs ? import <nixpkgs>,
3+
}:
24

3-
let common = import ./common.nix { inherit pkgs; };
5+
let
6+
common = import ./common.nix { inherit pkgs; };
47
in
58
with pkgs;
69
dockerTools.buildImage {

haproxy-mixin/common.nix

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
{ pkgs ? import <nixpkgs> }:
1+
{
2+
pkgs ? import <nixpkgs>,
3+
}:
24

35
with pkgs;
46
{
57
# devTools are packages specifically for development environments.
6-
devTools = [ docker docker-compose ];
8+
devTools = [
9+
docker
10+
docker-compose
11+
];
712
# buildTools are packages needed for dev and CI builds.
813
buildTools = [
914
bash

haproxy-mixin/flake.lock

Lines changed: 24 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

haproxy-mixin/flake.nix

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,34 @@
44
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
55
inputs.flake-utils.url = "github:numtide/flake-utils";
66

7-
outputs = { self, nixpkgs, flake-utils }:
7+
outputs =
88
{
9-
overlay =
10-
(final: prev: {
11-
jsonnet-bundler = prev.callPackage ./nix/jsonnet-bundler.nix { pkgs = prev; };
9+
self,
10+
nixpkgs,
11+
flake-utils,
12+
}:
13+
{
14+
overlay = (
15+
final: prev: {
1216
mixtool = prev.callPackage ./nix/mixtool.nix { pkgs = prev; };
13-
});
14-
} //
15-
(flake-utils.lib.eachDefaultSystem
16-
(system:
17-
let pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; };
18-
in
19-
{
20-
devShell = import ./shell.nix {
21-
inherit pkgs;
22-
};
23-
packages = {
24-
haproxy-mixin-build-image = import ./build-image.nix { inherit pkgs; };
25-
};
2617
}
27-
));
18+
);
19+
}
20+
// (flake-utils.lib.eachDefaultSystem (
21+
system:
22+
let
23+
pkgs = import nixpkgs {
24+
inherit system;
25+
overlays = [ self.overlay ];
26+
};
27+
in
28+
{
29+
devShell = import ./shell.nix {
30+
inherit pkgs;
31+
};
32+
packages = {
33+
haproxy-mixin-build-image = import ./build-image.nix { inherit pkgs; };
34+
};
35+
}
36+
));
2837
}

haproxy-mixin/nix/jsonnet-bundler.nix

Lines changed: 0 additions & 22 deletions
This file was deleted.

haproxy-mixin/nix/mixtool.nix

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
1-
{ pkgs ? import <nixpkgs> }:
1+
{
2+
pkgs ? import <nixpkgs>,
3+
}:
24

3-
with pkgs;
4-
buildGoModule rec {
5+
pkgs.buildGoModule (finalAttrs: {
56
pname = "mixtool";
6-
version = "bd0efc3";
7+
version = "0-unstable-2025-07-07";
78

8-
src = fetchFromGitHub {
9+
src = pkgs.fetchFromGitHub {
910
owner = "monitoring-mixins";
10-
repo = pname;
11-
rev = "${version}";
12-
sha256 = "1kh2axna553q7lrmgak8l7jlnmbdfkfci240bqa3040pd82j3q1c";
11+
repo = "mixtool";
12+
rev = "1abe34c3187d53b795d0474535b476bc9b7500c3";
13+
hash = "sha256-RRoz5Kp/IGkUD6XVK70+k4L05rYqhkqh6LpopihyEd8=";
1314
};
1415

15-
subPackages = [ "cmd/mixtool" ];
16-
vendorSha256 = "10wvckrwrc7xs3dng9m6lznsaways2wycxnl9h8jynp4h2cw22ml";
16+
vendorHash = "sha256-o9HNcq7XHXH/s6UthYADsktGh9NjgC1rVPbGP11Cfc0=";
1717

18-
meta = with lib; {
19-
description = "Helper for easily working with Jsonnet mixins";
20-
license = licenses.asl20;
18+
ldflags = [
19+
"-s"
20+
"-w"
21+
];
22+
23+
meta = {
24+
description = "Helper for easily working with jsonnet mixins";
25+
homepage = "https://github.com/monitoring-mixins/mixtool";
26+
license = pkgs.lib.licenses.asl20;
27+
maintainers = with pkgs.lib.maintainers; [ arikgrahl ];
28+
mainProgram = "mixtool";
2129
};
22-
}
30+
})

haproxy-mixin/shell.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
{ pkgs ? import <nixpkgs> }:
1+
{
2+
pkgs ? import <nixpkgs>,
3+
}:
24

35
with pkgs;
4-
let common = import ./common.nix { inherit pkgs; };
6+
let
7+
common = import ./common.nix { inherit pkgs; };
58
in
69
mkShell {
710
buildInputs = common.buildTools ++ common.devTools;

0 commit comments

Comments
 (0)