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.
This commit is contained in:
parent
24c8927c4a
commit
b3d4f5dada
@ -161,10 +161,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
|
||||
'';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user