packages/hercules-ci-agent: fix overrides, announce modified version

This commit is contained in:
Max Headroom 2023-01-29 23:26:24 +01:00
parent 25d75ce236
commit 3ba4ba9abb

View file

@ -17,16 +17,34 @@
# hci-agent's build code does some funny shenanigans # hci-agent's build code does some funny shenanigans
hercules-ci-agent = let hercules-ci-agent = let
original = packages.hercules-ci-agent.hercules-ci-agent; original = packages.hercules-ci-agent.hercules-ci-agent;
patchedNix = patch-rename-direct original.nix ({ version, ...}: "nix-${version}_hci2") "patches/extra/hercules-ci-agent/nix"; patchedNix = (patch original.nix "patches/extra/hercules-ci-agent/nix").overrideAttrs (old: rec {
in (original.override { name = "nix-${version}";
# for hercules-ci-cnix-expr, hercules-ci-cnix-store version = "${original.nix.version}_hci2";
nix = patchedNix; postUnpack = ''
# for cachix ${old.postUnpack or ""}
pkgs = pkgs // { nix = patchedNix; }; echo -n "${version}" > .version
}).overrideAttrs (old: { '';
# for hercules-ci-agent });
buildInputs = (lib.remove original.nix old.buildInputs) ++ [ patchedNix ]; forcePatchNix = old: {
}); buildInputs = (lib.remove original.nix old.buildInputs) ++ [ patchedNix ];
passthru = old.passthru // {
nix = patchedNix;
};
};
patchDeps = lib.const rec {
hercules-ci-cnix-store = packages.hercules-ci-agent.internal-hercules-ci-cnix-store.override (lib.const {
nix = patchedNix;
});
hercules-ci-cnix-expr = packages.hercules-ci-agent.internal-hercules-ci-cnix-expr.override (lib.const {
nix = patchedNix;
inherit hercules-ci-cnix-store;
});
cachix = pkgs.haskellPackages.cachix.override (lib.const {
nix = patchedNix;
inherit hercules-ci-cnix-store;
});
};
in (original.override patchDeps).overrideAttrs forcePatchNix;
hci = packages.hercules-ci-agent.hercules-ci-cli; hci = packages.hercules-ci-agent.hercules-ci-cli;
}; };