nixos/sudo-rs: align sudo and sudo-rs config

Since the latest release, sudo-rs supports all what we need
This commit is contained in:
r-vdp 2025-03-02 17:42:18 +01:00
parent f19139966a
commit 4e17c9546f
No known key found for this signature in database
2 changed files with 13 additions and 7 deletions

View file

@ -76,12 +76,18 @@
export TERM=$TERM
'';
security.sudo.extraConfig = lib.mkIf config.security.sudo.keepTerminfo ''
# Keep terminfo database for root and %wheel.
Defaults:root,%wheel env_keep+=TERMINFO_DIRS
Defaults:root,%wheel env_keep+=TERMINFO
'';
security =
let
extraConfig = ''
# Keep terminfo database for root and %wheel.
Defaults:root,%wheel env_keep+=TERMINFO_DIRS
Defaults:root,%wheel env_keep+=TERMINFO
'';
in
lib.mkIf config.security.sudo.keepTerminfo {
sudo = { inherit extraConfig; };
sudo-rs = { inherit extraConfig; };
};
};
}

View file

@ -36,7 +36,7 @@ in
defaultOptions = lib.mkOption {
type = with lib.types; listOf str;
default = [ ];
default = [ "SETENV" ];
description = ''
Options used for the default rules, granting `root` and the
`wheel` group permission to run any command as any user.