1 # The program `nuke-refs' created by this derivation replaces all
2 # references to the Nix store in the specified files by a non-existant
3 # path (/nix/store/eeee...). This is useful for getting rid of
4 # dependencies that you know are not actually needed at runtime.
6 { lib, stdenvNoCC, perl, signingUtils, shell ? stdenvNoCC.shell }:
11 darwinCodeSign = stdenv.targetPlatform.isDarwin && stdenv.targetPlatform.isAarch64;
14 stdenvNoCC.mkDerivation {
15 name = "nuke-references";
18 enableParallelBuilding = true;
25 substituteAll ${./nuke-refs.sh} $out/bin/nuke-refs
26 chmod a+x $out/bin/nuke-refs
29 postFixup = lib.optionalString darwinCodeSign ''
30 mkdir -p $out/nix-support
31 substituteAll ${./darwin-sign-fixup.sh} $out/nix-support/setup-hooks.sh
34 # FIXME: get rid of perl dependency.
37 inherit (builtins) storeDir;
38 shell = lib.getBin shell + (shell.shellPath or "");
39 signingUtils = lib.optionalString darwinCodeSign signingUtils;
42 meta.mainProgram = "nuke-refs";