git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #26897 from layus/nixos-terminfo

terminfo: symlink terminfo to /etc for ncurses

commit343ad1697d6967b7aa949752fd5c4471f691b4eb authorJörg Thalheim <Mic92@users.noreply.github.com> dateSat 1 Jul 2017, 09:27 (9 years ago) parentddf864fb73a862
6 files changed+37−9
nixos/modules/config/system-path.nix−1 nixos/modules/config/terminfo.nix+33 nixos/modules/module-list.nix+1 nixos/modules/programs/environment.nix−4 nixos/modules/security/sudo.nix−4 pkgs/development/libraries/ncurses/default.nix+3
nixos/modules/config/system-path.nix−1
@@ -115,7 +115,6 @@ in
115115 "/share/mime"
116116 "/share/nano"
117117 "/share/org"
118− "/share/terminfo"
119118 "/share/themes"
120119 "/share/vim-plugins"
121120 "/share/vulkan"
nixos/modules/config/terminfo.nixnew file+33
@@ -0,0 +1,33 @@
1+# This module manages the terminfo database
2+# and its integration in the system.
3+{ config, ... }:
4+{
5+ config = {
6+
7+ environment.pathsToLink = [
8+ "/share/terminfo"
9+ ];
10+
11+ environment.etc."terminfo" = {
12+ source = "${config.system.path}/share/terminfo";
13+ };
14+
15+ environment.profileRelativeEnvVars = {
16+ TERMINFO_DIRS = [ "/share/terminfo" ];
17+ };
18+
19+ environment.extraInit = ''
20+
21+ # reset TERM with new TERMINFO available (if any)
22+ export TERM=$TERM
23+ '';
24+
25+ security.sudo.extraConfig = ''
26+
27+ # Keep terminfo database for root and %wheel.
28+ Defaults:root,%wheel env_keep+=TERMINFO_DIRS
29+ Defaults:root,%wheel env_keep+=TERMINFO
30+ '';
31+
32+ };
33+}
nixos/modules/module-list.nix+1
@@ -21,6 +21,7 @@
2121 ./config/sysctl.nix
2222 ./config/system-environment.nix
2323 ./config/system-path.nix
24+ ./config/terminfo.nix
2425 ./config/timezone.nix
2526 ./config/unix-odbc-drivers.nix
2627 ./config/users-groups.nix
nixos/modules/programs/environment.nix−4
@@ -34,7 +34,6 @@ in
3434 { PATH = [ "/bin" ];
3535 INFOPATH = [ "/info" "/share/info" ];
3636 PKG_CONFIG_PATH = [ "/lib/pkgconfig" ];
37− TERMINFO_DIRS = [ "/share/terminfo" ];
3837 PERL5LIB = [ "/lib/perl5/site_perl" ];
3938 KDEDIRS = [ "" ];
4039 STRIGI_PLUGIN_PATH = [ "/lib/strigi/" ];
@@ -50,9 +49,6 @@ in
5049
5150 environment.extraInit =
5251 ''
53− # reset TERM with new TERMINFO available (if any)
54− export TERM=$TERM
55−
5652 unset ASPELL_CONF
5753 for i in ${concatStringsSep " " (reverseList cfg.profiles)} ; do
5854 if [ -d "$i/lib/aspell" ]; then
nixos/modules/security/sudo.nix−4
@@ -66,10 +66,6 @@ in
6666 # Don't edit this file. Set the NixOS options ‘security.sudo.configFile’
6767 # or ‘security.sudo.extraConfig’ instead.
6868
69− # Environment variables to keep for root and %wheel.
70− Defaults:root,%wheel env_keep+=TERMINFO_DIRS
71− Defaults:root,%wheel env_keep+=TERMINFO
72−
7369 # Keep SSH_AUTH_SOCK so that pam_ssh_agent_auth.so can do its magic.
7470 Defaults env_keep+=SSH_AUTH_SOCK
7571
pkgs/development/libraries/ncurses/default.nix+3
@@ -46,6 +46,9 @@ stdenv.mkDerivation rec {
4646 buildInputs = lib.optional (mouseSupport && stdenv.isLinux) gpm;
4747
4848 preConfigure = ''
49+ # These paths end up in the default lookup chain.
50+ export TERMINFO_DIRS=/etc/terminfo
51+
4952 export PKG_CONFIG_LIBDIR="$dev/lib/pkgconfig"
5053 mkdir -p "$PKG_CONFIG_LIBDIR"
5154 configureFlagsArray+=(