mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-30 11:50:06 +00:00
zfs: extend zpool scripts with :$PATH, remove sudo
sudo the package is not suid, so remove it from the PATH. Extend
PATH with $PATH to fetch sudo from the outer PATH. Move the generation
of `path` in to Nix, so the sed expression can use single quotes,
which prevents $PATH being interpolated at build-time.
(cherry picked from commit b3d4f5dada)
This commit is contained in:
@@ -165,10 +165,11 @@ let
|
||||
(cd $out/share/bash-completion/completions; ln -s zfs zpool)
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
path="PATH=${makeBinPath [ coreutils gawk gnused gnugrep utillinux smartmontools sysstat sudo ]}"
|
||||
postFixup = let
|
||||
path = "PATH=${makeBinPath [ coreutils gawk gnused gnugrep utillinux smartmontools sysstat ]}:$PATH";
|
||||
in ''
|
||||
for i in $out/libexec/zfs/zpool.d/*; do
|
||||
sed -i "2i$path" $i
|
||||
sed -i '2i${path}' $i
|
||||
done
|
||||
'';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user