From 3c555c6729c54957aa99bb91b0faf7f728c80811 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 23 Sep 2023 08:06:29 +0100 Subject: [PATCH] nut: strip debug symbols from cgi-bin/ Noticed by Majiir Paktu as a `gcc` development bits in the closure. The change remove 10 dependencies worth of 150MB from the closure: Before: $ nix path-info -rsSh ./result-before | nl | tail -n1 144 /nix/store/b0jsf912bix056gg3p1nz8lh3yasm82j-nut-2.8.0 10.0M 567.7M After: $ nix path-info -rsSh ./result | nl | tail -n1 134 /nix/store/gniv2fpm7qxdiszqwhz81iyvxpc62n52-nut-2.8.0 9.7M 343.8M --- pkgs/applications/misc/nut/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/applications/misc/nut/default.nix b/pkgs/applications/misc/nut/default.nix index 275d6bd3d84b..5596fc6010ec 100644 --- a/pkgs/applications/misc/nut/default.nix +++ b/pkgs/applications/misc/nut/default.nix @@ -57,6 +57,10 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; + # Add `cgi-bin` to the default list to avoid pulling in whole + # of `gcc` into build closure. + stripDebugList = [ "cgi-bin" "lib" "lib32" "lib64" "libexec" "bin" "sbin" ]; + postInstall = '' substituteInPlace $out/lib/systemd/system-shutdown/nutshutdown \ --replace /bin/sleep "${coreutils}/bin/sleep" \