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

Since the latest release, sudo-rs supports all what we need

r-vdp 4e17c954 f1913996

Changed files
+13 -7
nixos
modules
config
security
+12 -6
nixos/modules/config/terminfo.nix
···
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
-
'';
};
}
···
export TERM=$TERM
'';
+
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; };
+
};
};
}
+1 -1
nixos/modules/security/sudo-rs.nix
···
defaultOptions = lib.mkOption {
type = with lib.types; listOf str;
-
default = [ ];
description = ''
Options used for the default rules, granting `root` and the
`wheel` group permission to run any command as any user.
···
defaultOptions = lib.mkOption {
type = with lib.types; listOf str;
+
default = [ "SETENV" ];
description = ''
Options used for the default rules, granting `root` and the
`wheel` group permission to run any command as any user.