diff options
author | nicoo <nicoo@mur.at> | 2023-09-04 23:05:00 +0000 |
---|---|---|
committer | nicoo <nicoo@mur.at> | 2023-09-18 17:35:06 +0000 |
commit | 0365b05f13a4230d75bb63708694ee4692638236 (patch) | |
tree | 7bb11c076f3b9f96c69e6a7e4613c81b372f77ce /nixos/modules/config | |
parent | 8742134c80539b3f8e9c7c51b13a225a92e97b9a (diff) | |
download | nixlib-0365b05f13a4230d75bb63708694ee4692638236.tar nixlib-0365b05f13a4230d75bb63708694ee4692638236.tar.gz nixlib-0365b05f13a4230d75bb63708694ee4692638236.tar.bz2 nixlib-0365b05f13a4230d75bb63708694ee4692638236.tar.lz nixlib-0365b05f13a4230d75bb63708694ee4692638236.tar.xz nixlib-0365b05f13a4230d75bb63708694ee4692638236.tar.zst nixlib-0365b05f13a4230d75bb63708694ee4692638236.zip |
nixos/terminfo: Add config option not to add extra sudo config
This will be necessary for compatibility with `sudo-rs`.
Diffstat (limited to 'nixos/modules/config')
-rw-r--r-- | nixos/modules/config/terminfo.nix | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/nixos/modules/config/terminfo.nix b/nixos/modules/config/terminfo.nix index 1ae8e82c471e..ebd1aaea8f04 100644 --- a/nixos/modules/config/terminfo.nix +++ b/nixos/modules/config/terminfo.nix @@ -6,12 +6,23 @@ with lib; { - options.environment.enableAllTerminfo = with lib; mkOption { - default = false; - type = types.bool; - description = lib.mdDoc '' - Whether to install all terminfo outputs - ''; + options = with lib; { + environment.enableAllTerminfo = mkOption { + default = false; + type = types.bool; + description = lib.mdDoc '' + Whether to install all terminfo outputs + ''; + }; + + security.sudo.keepTerminfo = mkOption { + default = true; + type = types.bool; + description = lib.mdDoc '' + Whether to preserve the `TERMINFO` and `TERMINFO_DIRS` + environment variables, for `root` and the `wheel` group. + ''; + }; }; config = { @@ -54,7 +65,7 @@ with lib; export TERM=$TERM ''; - security.sudo.extraConfig = '' + security.sudo.extraConfig = mkIf config.security.sudo.keepTerminfo '' # Keep terminfo database for root and %wheel. Defaults:root,%wheel env_keep+=TERMINFO_DIRS |