From bba8583a218b3c0eed6809a3b75ee8d305cdfc29 Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Tue, 12 Dec 2023 09:30:21 -0600 Subject: [PATCH] Add "terminfo" and "shell_integration" subpackages to the Nix package so that the Ghostty terminfo and shell integration files can be installed on a headless server without copying all of Ghostty to the server. Implementation liberally cribbed from the Kitty Nix package. --- nix/package.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/nix/package.nix b/nix/package.nix index ed47aeaee..7a3ebfa05 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -125,7 +125,21 @@ in stdenv.mkDerivation (finalAttrs: { chmod u+rwX -R $ZIG_GLOBAL_CACHE_DIR ''; - outputs = [ "out" ]; + outputs = [ "out" "terminfo" "shell_integration" ]; + + postInstall = '' + terminfo_src=${ + if stdenv.isDarwin + then ''"$out/Applications/Ghostty.app/Contents/Resources/terminfo"'' + else "$out/share/terminfo" + } + + mkdir -p $terminfo/share + cp -r "$terminfo_src" $terminfo/share/terminfo + + mkdir -p $shell_integration + cp -r $out/share/shell-integration $shell_integration/shell-integration + ''; meta = with lib; { homepage = "https://github.com/mitchellh/ghostty";