Files
nixpkgs/pkgs/by-name/hc/hci/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

64 lines
1.7 KiB
Nix

{
crun,
haskell,
haskellPackages,
lib,
makeWrapper,
stdenv,
emptyDirectory,
}:
let
inherit (haskell.lib.compose)
overrideCabal
addBuildTools
justStaticExecutables
appendConfigureFlags
;
inherit (lib) makeBinPath;
bundledBins = lib.optional stdenv.hostPlatform.isLinux crun;
overrides = old: {
hercules-ci-agent = overrideCabal (o: {
isLibrary = true;
isExecutable = false;
postInstall = ""; # ignore completions
enableSharedExecutables = false;
buildTarget = "lib:hercules-ci-agent hercules-ci-agent-unit-tests";
configureFlags = o.configureFlags or [ ] ++ [
"--bindir=${emptyDirectory}/hercules-ci-built-without-binaries/no-bin"
];
}) old.hercules-ci-agent;
};
pkg =
# justStaticExecutables is needed due to https://github.com/NixOS/nix/issues/2990
overrideCabal
(o: {
postInstall = ''
${o.postInstall or ""}
mkdir -p $out/libexec
mv $out/bin/hci $out/libexec
makeWrapper $out/libexec/hci $out/bin/hci --prefix PATH : ${lib.escapeShellArg (makeBinPath bundledBins)}
'';
})
(
addBuildTools [ makeWrapper ]
# TODO: Erroneous references to GHC on aarch64-darwin: https://github.com/NixOS/nixpkgs/issues/318013
(
(
if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64 then
lib.id
else
haskell.lib.compose.justStaticExecutables
)
(haskellPackages.hercules-ci-cli.override overrides)
)
);
in
pkg
// {
meta = pkg.meta // {
position = toString ./package.nix + ":1";
};
}