diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index 8f2280e86e..541c79aa7c 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -82,4 +82,6 @@ fr24feed = pkgs.callPackage ./fr24feed { }; qrca = pkgs.libsForQt5.callPackage ./qrca { }; + + terminfos = pkgs.callPackage ./terminfos { }; } // (import ./heptapod-runner args) diff --git a/nix/pkgs/terminfos/default.nix b/nix/pkgs/terminfos/default.nix new file mode 100644 index 0000000000..934e7fda10 --- /dev/null +++ b/nix/pkgs/terminfos/default.nix @@ -0,0 +1,32 @@ +{ stdenvNoCC, kitty, ncurses, rxvt-unicode-unwrapped, alacritty, symlinkJoin }: + +let + kitty-terminfo = stdenvNoCC.mkDerivation { + pname = "kitty-terminfo"; + inherit (kitty) version src; + + dontBuild = true; + + nativeBuildInputs = [ + ncurses + ]; + + installPhase = '' + runHook preInstall + + install -d $out/share/terminfo + export TERMINFO=$out/share/terminfo + tic -x terminfo/kitty.terminfo + + runHook postInstall + ''; + }; +in + symlinkJoin { + name = "terminfos"; + paths = [ + kitty-terminfo + rxvt-unicode-unwrapped.terminfo + alacritty.terminfo + ]; + } diff --git a/ops/nixos/lib/home-manager/common.nix b/ops/nixos/lib/home-manager/common.nix index 550cfc015c..b5bf4f200c 100644 --- a/ops/nixos/lib/home-manager/common.nix +++ b/ops/nixos/lib/home-manager/common.nix @@ -1,6 +1,23 @@ { config, configName, depot, lib, pkgs, ... }: let inherit (pkgs.stdenv.hostPlatform) isDarwin isLinux; + + kitty-terminfo = pkgs.mkDerivation { + pname = "kitty-terminfo"; + inherit (pkgs.kitty) version src; + + dontBuild = true; + + installPhase = '' + runHook preInstall + + install -d $out/share/terminfo + export TERMINFO=$out/share/terminfo + tic terminfo/kitty.terminfo + + runHook postInstall + ''; + }; in { imports = [ ./ntfy.nix ]; @@ -26,7 +43,9 @@ in home.homeDirectory = if isDarwin then "/Users/lukegb" else "/home/lukegb"; home.file = { ".hgrc".source = ./hgrc; - }; + } // (lib.optionalAttrs isDarwin { + ".terminfo".source = depot.nix.pkgs.terminfos; + }); home.sessionVariables = { EDITOR = "vim"; VISUAL = "vim"; @@ -133,8 +152,8 @@ in #!/bin/sh exec "${home-manager}/bin/home-manager" -f "${config.home.homeDirectory}/depot/home-manager-ext.nix" -A "${configName}" "$@" '') - rxvt-unicode-unwrapped.terminfo tmux rsync libarchive tcpdump restic - alacritty.terminfo kitty.terminfo + tmux rsync libarchive tcpdump restic + depot.nix.pkgs.terminfos iftop htop jq depot.nix.pkgs.mercurial ] ++ lib.optionals isLinux [