diff options
author | Artturin <Artturin@artturin.com> | 2023-03-23 19:34:04 +0200 |
---|---|---|
committer | Artturin <Artturin@artturin.com> | 2023-03-24 20:11:33 +0200 |
commit | 780669daf57856d62e672de050324a75f1a66c81 (patch) | |
tree | c3b1960b1246885dc7e4c824b1ac909543623df5 | |
parent | 3b7218e93db3e24fec777da4cbb2891c7012052d (diff) | |
download | nixpkgs-780669daf57856d62e672de050324a75f1a66c81.tar nixpkgs-780669daf57856d62e672de050324a75f1a66c81.tar.gz nixpkgs-780669daf57856d62e672de050324a75f1a66c81.tar.bz2 nixpkgs-780669daf57856d62e672de050324a75f1a66c81.tar.lz nixpkgs-780669daf57856d62e672de050324a75f1a66c81.tar.xz nixpkgs-780669daf57856d62e672de050324a75f1a66c81.tar.zst nixpkgs-780669daf57856d62e672de050324a75f1a66c81.zip |
treewide: don't hardcode /nix/store (no rebuilds changes)
improve experience for other store locations
9 files changed, 11 insertions, 11 deletions
diff --git a/pkgs/applications/networking/ids/suricata/default.nix b/pkgs/applications/networking/ids/suricata/default.nix index bf7626759b3..e10c87e683c 100644 --- a/pkgs/applications/networking/ids/suricata/default.nix +++ b/pkgs/applications/networking/ids/suricata/default.nix @@ -121,7 +121,7 @@ stdenv.mkDerivation rec { postConfigure = '' # Avoid unintended clousure growth. - sed -i 's|/nix/store/\(.\{8\}\)[^-]*-|/nix/store/\1...-|g' ./src/build-info.h + sed -i 's|${builtins.storeDir}/\(.\{8\}\)[^-]*-|${builtins.storeDir}/\1...-|g' ./src/build-info.h ''; hardeningDisable = [ "stackprotector" ]; diff --git a/pkgs/applications/networking/mailreaders/evolution/evolution/wrapper.nix b/pkgs/applications/networking/mailreaders/evolution/evolution/wrapper.nix index 0a4a4a9d779..6b65211d0b4 100644 --- a/pkgs/applications/networking/mailreaders/evolution/evolution/wrapper.nix +++ b/pkgs/applications/networking/mailreaders/evolution/evolution/wrapper.nix @@ -23,7 +23,7 @@ symlinkJoin { fixSymlink () { local link=$1 local target=$(readlink $link); - local newtarget=$(sed "s@/nix/store/[^/]*/@$out/@" <<< "$target") + local newtarget=$(sed "s@${builtins.storeDir}/[^/]*/@$out/@" <<< "$target") if [[ $target != $newtarget ]] && [[ -d $newtarget ]]; then echo fixing link to point to $newtarget instead of $target rm $link @@ -35,7 +35,7 @@ symlinkJoin { fixSymlink $out/lib/systemd/user for i in $out/share/dbus-1/services/*.service $out/lib/systemd/user/*.service; do echo fixing service file $i to point to $out - sed -i "s@/nix/store/[^/]*/@$out/@" $i + sed -i "s@${builtins.storeDir}/[^/]*/@$out/@" $i done ''; } diff --git a/pkgs/applications/science/math/giac/default.nix b/pkgs/applications/science/math/giac/default.nix index df7639dc6c2..33770835136 100644 --- a/pkgs/applications/science/math/giac/default.nix +++ b/pkgs/applications/science/math/giac/default.nix @@ -111,7 +111,7 @@ stdenv.mkDerivation rec { # notably texlive, and we don't want texlive to become a runtime # dependency for file in $(find $out -name Makefile) ; do - sed -i "s@/nix/store/[^/]*/bin/@@" "$file" ; + sed -i "s@${builtins.storeDir}/[^/]*/bin/@@" "$file" ; done; # reference cycle diff --git a/pkgs/build-support/dotnet/build-dotnet-module/default.nix b/pkgs/build-support/dotnet/build-dotnet-module/default.nix index 32e8cbd2b1a..8858d4e9877 100644 --- a/pkgs/build-support/dotnet/build-dotnet-module/default.nix +++ b/pkgs/build-support/dotnet/build-dotnet-module/default.nix @@ -176,7 +176,7 @@ stdenvNoCC.mkDerivation (args // { # Note that toString is necessary here as it results in the path at # eval time (i.e. to the file in your local Nixpkgs checkout) rather # than the Nix store path of the path after it's been imported. - if lib.isPath nugetDeps && !lib.hasPrefix "/nix/store/" (toString nugetDeps) + if lib.isPath nugetDeps && !lib.hasPrefix "${builtins.storeDir}/" (toString nugetDeps) then toString nugetDeps else ''$(mktemp -t "${pname}-deps-XXXXXX.nix")''; in diff --git a/pkgs/build-support/fetchdocker/default.nix b/pkgs/build-support/fetchdocker/default.nix index 57d2e4ad82d..ef6132bfe3a 100644 --- a/pkgs/build-support/fetchdocker/default.nix +++ b/pkgs/build-support/fetchdocker/default.nix @@ -3,7 +3,7 @@ let stripScheme = builtins.replaceStrings [ "https://" "http://" ] [ "" "" ]; stripNixStore = - s: lib.removePrefix "/nix/store/" s; + s: lib.removePrefix "${builtins.storeDir}/" s; in { name , registry ? "https://registry-1.docker.io/v2/" diff --git a/pkgs/build-support/release/nix-build.nix b/pkgs/build-support/release/nix-build.nix index 0498232d4d6..83e521bb65c 100644 --- a/pkgs/build-support/release/nix-build.nix +++ b/pkgs/build-support/release/nix-build.nix @@ -140,7 +140,7 @@ stdenv.mkDerivation ( (lib.optional doCoverityAnalysis args.cov-build) ++ (lib.optional doCoverityAnalysis args.xz); - lcovFilter = ["/nix/store/*"] ++ lcovFilter; + lcovFilter = ["${builtins.storeDir}/*"] ++ lcovFilter; inherit lcovExtraTraceFiles; diff --git a/pkgs/games/cataclysm-dda/wrapper.nix b/pkgs/games/cataclysm-dda/wrapper.nix index a73c320f9c6..28189fa7375 100644 --- a/pkgs/games/cataclysm-dda/wrapper.nix +++ b/pkgs/games/cataclysm-dda/wrapper.nix @@ -34,7 +34,7 @@ else symlinkJoin { cp "$1" "''${1}.bk" unlink "$1" mv "''${1}.bk" "$1" - sed -i "$1" -e "s,/nix/store/.\+\(/bin/cataclysm-tiles\),$out\1," + sed -i "$1" -e "s,${builtins.storeDir}/.\+\(/bin/cataclysm-tiles\),$out\1," } for script in "$out/share/applications/cataclysm-dda.desktop" \ "$out/Applications/Cataclysm.app/Contents/MacOS/Cataclysm.sh" diff --git a/pkgs/os-specific/linux/sysdig/default.nix b/pkgs/os-specific/linux/sysdig/default.nix index 2d27ecb3403..bd92fab0866 100644 --- a/pkgs/os-specific/linux/sysdig/default.nix +++ b/pkgs/os-specific/linux/sysdig/default.nix @@ -115,7 +115,7 @@ stdenv.mkDerivation rec { + lib.optionalString (kernel != null) '' make install_driver kernel_dev=${kernel.dev} - kernel_dev=''${kernel_dev#/nix/store/} + kernel_dev=''${kernel_dev#${builtins.storeDir}/} kernel_dev=''${kernel_dev%%-linux*dev*} if test -f "$out/lib/modules/${kernel.modDirVersion}/extra/scap.ko"; then sed -i "s#$kernel_dev#................................#g" $out/lib/modules/${kernel.modDirVersion}/extra/scap.ko diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 9dda9cd2d4a..08333aa8a14 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -304,8 +304,8 @@ stdenv.mkDerivation (finalAttrs: { if dl.pkg == null then '' # remove the dependency on the library by replacing it with an invalid path for file in $(grep -lr '"${dl.name}"' src); do - echo "patching dlopen(\"${dl.name}\", …) in $file to an invalid store path ("/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-not-implemented/${dl.name}")…" - substituteInPlace "$file" --replace '"${dl.name}"' '"/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-not-implemented/${dl.name}"' + echo "patching dlopen(\"${dl.name}\", …) in $file to an invalid store path ("${builtins.storeDir}/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-not-implemented/${dl.name}")…" + substituteInPlace "$file" --replace '"${dl.name}"' '"${builtins.storeDir}/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-not-implemented/${dl.name}"' done '' else '' # ensure that the library we provide actually exists |