about summary refs log tree commit diff
path: root/nixos/modules/config/terminfo.nix
diff options
context:
space:
mode:
authorGuillaume Maudoux <guillaume.maudoux@uclouvain.be>2017-06-27 10:57:44 +0200
committerGuillaume Maudoux <guillaume.maudoux@uclouvain.be>2017-06-30 11:17:11 +0200
commitbd562949cfa82b76ef5959bd53ee9596bc35e705 (patch)
treebcf106a87ca0c64f15fdaf8738707fbb869b7d96 /nixos/modules/config/terminfo.nix
parentd61c22341b00171b53697164cb8241184979d14c (diff)
downloadnixlib-bd562949cfa82b76ef5959bd53ee9596bc35e705.tar
nixlib-bd562949cfa82b76ef5959bd53ee9596bc35e705.tar.gz
nixlib-bd562949cfa82b76ef5959bd53ee9596bc35e705.tar.bz2
nixlib-bd562949cfa82b76ef5959bd53ee9596bc35e705.tar.lz
nixlib-bd562949cfa82b76ef5959bd53ee9596bc35e705.tar.xz
nixlib-bd562949cfa82b76ef5959bd53ee9596bc35e705.tar.zst
nixlib-bd562949cfa82b76ef5959bd53ee9596bc35e705.zip
terminfo: symlink terminfo to /etc for ncurses
Diffstat (limited to 'nixos/modules/config/terminfo.nix')
-rw-r--r--nixos/modules/config/terminfo.nix33
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
+    '';
+
+  };
+}