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,7 +26,8 @@
|
|||
# wrapper for nh as it doesn't work with `doas`
|
||||
body = ''
|
||||
if count $argv > /dev/null
|
||||
if contains -- os $argv or contains -- clean $argv
|
||||
set subcommand (string join " " $argv)
|
||||
if contains -- $subcommand "os switch" "os test" "os boot" "clean all"
|
||||
doas ${pkgs.nh}/bin/nh $argv -R
|
||||
else
|
||||
${pkgs.nh}/bin/nh $argv
|
||||
|
|
Loading…
Reference in a new issue