doas: add NixOS binary dirs to safe PATH
I recently tried to give myself passwordless `doas` for `virsh` commands
(starting, stopping, and editing VMs), but `doas` was complaining that
it didn't know what `virsh` was.
This patch adds `/run/current-system/sw/{s,}bin` and `/run/wrappers/bin`
to the safe path, allowing system binaries to be discovered and executed
properly.
This commit is contained in:
@@ -26,6 +26,12 @@ stdenv.mkDerivation rec {
|
||||
"--pamdir=${placeholder "out"}/etc/pam.d"
|
||||
];
|
||||
|
||||
patches = [
|
||||
# Allow doas to discover binaries in /run/current-system/sw/{s,}bin and
|
||||
# /run/wrappers/bin
|
||||
./0001-add-NixOS-specific-dirs-to-safe-PATH.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
sed -i '/\(chown\|chmod\)/d' bsd.prog.mk
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user