lol

Merge pull request #140607 from jkarlson/terminfo

authored by

Sandro and committed by
GitHub
d8cec85c ce75dc58

+61 -2
+25 -1
nixos/modules/config/terminfo.nix
··· 1 1 # This module manages the terminfo database 2 2 # and its integration in the system. 3 - { config, ... }: 3 + { config, lib, pkgs, ... }: 4 + 5 + with lib; 6 + 4 7 { 8 + 9 + options.environment.enableAllTerminfo = with lib; mkOption { 10 + default = false; 11 + type = types.bool; 12 + description = '' 13 + Whether to install all terminfo outputs 14 + ''; 15 + }; 16 + 5 17 config = { 18 + 19 + # can be generated with: filter (drv: (builtins.tryEval (drv ? terminfo)).value) (attrValues pkgs) 20 + environment.systemPackages = mkIf config.environment.enableAllTerminfo (map (x: x.terminfo) (with pkgs; [ 21 + alacritty 22 + foot 23 + kitty 24 + mtm 25 + rxvt-unicode-unwrapped 26 + rxvt-unicode-unwrapped-emoji 27 + termite 28 + wezterm 29 + ])); 6 30 7 31 environment.pathsToLink = [ 8 32 "/share/terminfo"
+31
nixos/tests/all-terminfo.nix
··· 1 + import ./make-test-python.nix ({ pkgs, ... }: rec { 2 + name = "all-terminfo"; 3 + meta = with pkgs.lib.maintainers; { 4 + maintainers = [ jkarlson ]; 5 + }; 6 + 7 + nodes.machine = { pkgs, config, lib, ... }: 8 + let 9 + infoFilter = name: drv: 10 + let 11 + o = builtins.tryEval drv; 12 + in 13 + o.success && lib.isDerivation o.value && o.value ? outputs && builtins.elem "terminfo" o.value.outputs; 14 + terminfos = lib.filterAttrs infoFilter pkgs; 15 + excludedTerminfos = lib.filterAttrs (_: drv: !(builtins.elem drv.terminfo config.environment.systemPackages)) terminfos; 16 + includedOuts = lib.filterAttrs (_: drv: builtins.elem drv.out config.environment.systemPackages) terminfos; 17 + in 18 + { 19 + environment = { 20 + enableAllTerminfo = true; 21 + etc."terminfo-missing".text = builtins.concatStringsSep "\n" (builtins.attrNames excludedTerminfos); 22 + etc."terminfo-extra-outs".text = builtins.concatStringsSep "\n" (builtins.attrNames includedOuts); 23 + }; 24 + }; 25 + 26 + testScript = 27 + '' 28 + machine.fail("grep . /etc/terminfo-missing >&2") 29 + machine.fail("grep . /etc/terminfo-extra-outs >&2") 30 + ''; 31 + })
+1
nixos/tests/all-tests.nix
··· 35 35 agate = handleTest ./web-servers/agate.nix {}; 36 36 agda = handleTest ./agda.nix {}; 37 37 airsonic = handleTest ./airsonic.nix {}; 38 + allTerminfo = handleTest ./all-terminfo.nix {}; 38 39 amazon-init-shell = handleTest ./amazon-init-shell.nix {}; 39 40 apfs = handleTest ./apfs.nix {}; 40 41 apparmor = handleTest ./apparmor.nix {};
+4 -1
pkgs/applications/terminal-emulators/wezterm/default.nix
··· 100 100 ln -s $out/bin/{wezterm,wezterm-mux-server,wezterm-gui,strip-ansi-escapes} "$OUT_APP" 101 101 ''; 102 102 103 - passthru.tests.test = nixosTests.terminal-emulators.wezterm; 103 + passthru.tests = { 104 + all-terminfo = nixosTests.allTerminfo; 105 + test = nixosTests.terminal-emulators.wezterm; 106 + }; 104 107 105 108 meta = with lib; { 106 109 description = "A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust";