1 # This module manages the terminfo database
2 # and its integration in the system.
3 { config, lib, pkgs, ... }:
7 environment.enableAllTerminfo = lib.mkOption {
11 Whether to install all terminfo outputs
15 security.sudo.keepTerminfo = lib.mkOption {
17 type = lib.types.bool;
19 Whether to preserve the `TERMINFO` and `TERMINFO_DIRS`
20 environment variables, for `root` and the `wheel` group.
27 # This should not contain packages that are broken or can't build, since it
28 # will break this expression
30 # Currently broken packages:
33 # can be generated with:
34 # lib.attrNames (lib.filterAttrs
35 # (_: drv: (builtins.tryEval (lib.isDerivation drv && drv ? terminfo)).value)
37 environment.systemPackages = lib.mkIf config.environment.enableAllTerminfo (
39 with pkgs.pkgsBuildBuild;
46 rxvt-unicode-unwrapped
47 rxvt-unicode-unwrapped-emoji
57 environment.pathsToLink = [
61 environment.etc.terminfo = {
62 source = "${config.system.path}/share/terminfo";
65 environment.profileRelativeSessionVariables = {
66 TERMINFO_DIRS = [ "/share/terminfo" ];
69 environment.extraInit = ''
71 # reset TERM with new TERMINFO available (if any)
75 security.sudo.extraConfig = lib.mkIf config.security.sudo.keepTerminfo ''
77 # Keep terminfo database for root and %wheel.
78 Defaults:root,%wheel env_keep+=TERMINFO_DIRS
79 Defaults:root,%wheel env_keep+=TERMINFO