mirror of
https://github.com/youwen5/nixos.git
synced 2025-01-17 20:52:09 -08:00
feat: nh doas wrapper only runs under root for commands that need root
This commit is contained in:
parent
f3bc3dcf65
commit
71829db15f
1 changed files with 6 additions and 5 deletions
|
@ -26,11 +26,12 @@
|
||||||
# wrapper for nh as it doesn't work with `doas`
|
# wrapper for nh as it doesn't work with `doas`
|
||||||
body = ''
|
body = ''
|
||||||
if count $argv > /dev/null
|
if count $argv > /dev/null
|
||||||
if contains -- os $argv or contains -- clean $argv
|
set subcommand (string join " " $argv)
|
||||||
doas ${pkgs.nh}/bin/nh $argv -R
|
if contains -- $subcommand "os switch" "os test" "os boot" "clean all"
|
||||||
else
|
doas ${pkgs.nh}/bin/nh $argv -R
|
||||||
${pkgs.nh}/bin/nh $argv
|
else
|
||||||
end
|
${pkgs.nh}/bin/nh $argv
|
||||||
|
end
|
||||||
else
|
else
|
||||||
${pkgs.nh}/bin/nh
|
${pkgs.nh}/bin/nh
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue