Skip to content

chore: update Nix tooling for HAProxy #1467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions haproxy-mixin/build-image.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{ pkgs ? import <nixpkgs> }:
{
pkgs ? import <nixpkgs>,
}:

let common = import ./common.nix { inherit pkgs; };
let
common = import ./common.nix { inherit pkgs; };
in
with pkgs;
dockerTools.buildImage {
Expand Down
9 changes: 7 additions & 2 deletions haproxy-mixin/common.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{ pkgs ? import <nixpkgs> }:
{
pkgs ? import <nixpkgs>,
}:

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
Expand Down
30 changes: 24 additions & 6 deletions haproxy-mixin/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 27 additions & 18 deletions haproxy-mixin/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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; };
};
}
));
}
22 changes: 0 additions & 22 deletions haproxy-mixin/nix/jsonnet-bundler.nix

This file was deleted.

36 changes: 22 additions & 14 deletions haproxy-mixin/nix/mixtool.nix
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
{ pkgs ? import <nixpkgs> }:
{
pkgs ? import <nixpkgs>,
}:

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";
};
}
})
7 changes: 5 additions & 2 deletions haproxy-mixin/shell.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{ pkgs ? import <nixpkgs> }:
{
pkgs ? import <nixpkgs>,
}:

with pkgs;
let common = import ./common.nix { inherit pkgs; };
let
common = import ./common.nix { inherit pkgs; };
in
mkShell {
buildInputs = common.buildTools ++ common.devTools;
Expand Down
Loading