From bd562949cfa82b76ef5959bd53ee9596bc35e705 Mon Sep 17 00:00:00 2001 From: Guillaume Maudoux Date: Tue, 27 Jun 2017 10:57:44 +0200 Subject: terminfo: symlink terminfo to /etc for ncurses --- nixos/modules/config/terminfo.nix | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 nixos/modules/config/terminfo.nix (limited to 'nixos/modules/config/terminfo.nix') 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 + ''; + + }; +} -- cgit 1.4.1