diff options
author | Guillaume Maudoux <guillaume.maudoux@uclouvain.be> | 2017-06-27 10:57:44 +0200 |
---|---|---|
committer | Guillaume Maudoux <guillaume.maudoux@uclouvain.be> | 2017-06-30 11:17:11 +0200 |
commit | bd562949cfa82b76ef5959bd53ee9596bc35e705 (patch) | |
tree | bcf106a87ca0c64f15fdaf8738707fbb869b7d96 /nixos/modules/config/terminfo.nix | |
parent | d61c22341b00171b53697164cb8241184979d14c (diff) |
terminfo: symlink terminfo to /etc for ncurses
Diffstat (limited to 'nixos/modules/config/terminfo.nix')
-rw-r--r-- | nixos/modules/config/terminfo.nix | 33 |
1 files changed, 33 insertions, 0 deletions
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 + ''; + + }; +} |