about summary refs log tree commit diff
path: root/pkgs/development/tools/continuous-integration
diff options
context:
space:
mode:
authorRobert Hensing <roberth@users.noreply.github.com>2023-10-07 13:17:55 +0200
committerGitHub <noreply@github.com>2023-10-07 13:17:55 +0200
commit08af27d910bdb4c284407f83e8da0c6ede3ff9df (patch)
tree06130aa36f0a23c39c185da1dc4b1252511ff0eb /pkgs/development/tools/continuous-integration
parent70890d855e56ded11ce7721e7ee23cb704cfc78c (diff)
parent10bb5b600848c012b7e8b5ea122878836101e264 (diff)
downloadnixlib-08af27d910bdb4c284407f83e8da0c6ede3ff9df.tar
nixlib-08af27d910bdb4c284407f83e8da0c6ede3ff9df.tar.gz
nixlib-08af27d910bdb4c284407f83e8da0c6ede3ff9df.tar.bz2
nixlib-08af27d910bdb4c284407f83e8da0c6ede3ff9df.tar.lz
nixlib-08af27d910bdb4c284407f83e8da0c6ede3ff9df.tar.xz
nixlib-08af27d910bdb4c284407f83e8da0c6ede3ff9df.tar.zst
nixlib-08af27d910bdb4c284407f83e8da0c6ede3ff9df.zip
Merge pull request #259359 from hercules-ci/hci-output-closure-size
hci: Improve closure size
Diffstat (limited to 'pkgs/development/tools/continuous-integration')
-rw-r--r--pkgs/development/tools/continuous-integration/hci/default.nix22
1 files changed, 19 insertions, 3 deletions
diff --git a/pkgs/development/tools/continuous-integration/hci/default.nix b/pkgs/development/tools/continuous-integration/hci/default.nix
index 5060d0aeda01..1acafb10eabc 100644
--- a/pkgs/development/tools/continuous-integration/hci/default.nix
+++ b/pkgs/development/tools/continuous-integration/hci/default.nix
@@ -1,9 +1,25 @@
-{ haskell, haskellPackages, lib, makeWrapper, runc, stdenv }:
+{ haskell, haskellPackages, lib, makeWrapper, runc, stdenv, emptyDirectory }:
 let
-  inherit (haskell.lib.compose) overrideCabal addBuildTools justStaticExecutables;
+  inherit (haskell.lib.compose) overrideCabal addBuildTools justStaticExecutables appendConfigureFlags;
   inherit (lib) makeBinPath;
   bundledBins = lib.optional stdenv.isLinux runc;
 
+  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
@@ -15,7 +31,7 @@ let
           makeWrapper $out/libexec/hci $out/bin/hci --prefix PATH : ${lib.escapeShellArg (makeBinPath bundledBins)}
         '';
       })
-      (addBuildTools [ makeWrapper ] (justStaticExecutables haskellPackages.hercules-ci-cli));
+      (addBuildTools [ makeWrapper ] (justStaticExecutables (haskellPackages.hercules-ci-cli.override overrides)));
 in pkg // {
     meta = pkg.meta // {
       position = toString ./default.nix + ":1";