diff options
Diffstat (limited to 'nixos/modules/config')
-rw-r--r-- | nixos/modules/config/system-path.nix | 1 | ||||
-rw-r--r-- | nixos/modules/config/terminfo.nix | 33 |
2 files changed, 33 insertions, 1 deletions
diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix index 3ac5f634c7a6..cf3cc2f22628 100644 --- a/nixos/modules/config/system-path.nix +++ b/nixos/modules/config/system-path.nix @@ -115,7 +115,6 @@ in "/share/mime" "/share/nano" "/share/org" - "/share/terminfo" "/share/themes" "/share/vim-plugins" "/share/vulkan" diff --git a/nixos/modules/config/terminfo.nix b/nixos/modules/config/terminfo.nix new file mode 100644 index 000000000000..4fd6ba5ea605 --- /dev/null +++ b/nixos/modules/config/terminfo.nix @@ -0,0 +1,33 @@ +# This module manages the terminfo database +# and its integration in the system. +{ config, ... }: +{ + config = { + + environment.pathsToLink = [ + "/share/terminfo" + ]; + + environment.etc."terminfo" = { + source = "${config.system.path}/share/terminfo"; + }; + + environment.profileRelativeEnvVars = { + TERMINFO_DIRS = [ "/share/terminfo" ]; + }; + + environment.extraInit = '' + + # reset TERM with new TERMINFO available (if any) + export TERM=$TERM + ''; + + security.sudo.extraConfig = '' + + # Keep terminfo database for root and %wheel. + Defaults:root,%wheel env_keep+=TERMINFO_DIRS + Defaults:root,%wheel env_keep+=TERMINFO + ''; + + }; +} |