Skip to content

Commit 4e17c95

Browse files
committed
nixos/sudo-rs: align sudo and sudo-rs config
Since the latest release, sudo-rs supports all what we need
1 parent f191399 commit 4e17c95

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

nixos/modules/config/terminfo.nix

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,18 @@
7676
export TERM=$TERM
7777
'';
7878

79-
security.sudo.extraConfig = lib.mkIf config.security.sudo.keepTerminfo ''
80-
81-
# Keep terminfo database for root and %wheel.
82-
Defaults:root,%wheel env_keep+=TERMINFO_DIRS
83-
Defaults:root,%wheel env_keep+=TERMINFO
84-
'';
79+
security =
80+
let
81+
extraConfig = ''
8582
83+
# Keep terminfo database for root and %wheel.
84+
Defaults:root,%wheel env_keep+=TERMINFO_DIRS
85+
Defaults:root,%wheel env_keep+=TERMINFO
86+
'';
87+
in
88+
lib.mkIf config.security.sudo.keepTerminfo {
89+
sudo = { inherit extraConfig; };
90+
sudo-rs = { inherit extraConfig; };
91+
};
8692
};
8793
}

nixos/modules/security/sudo-rs.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ in
3636

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

0 commit comments

Comments
 (0)