aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/nix/package.nix
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-04-04 19:22:04 +0300
committerCan Celik <ogulcancelik@gmail.com>2026-04-05 01:23:06 +0300
commit41dd733ca7123c9ac4bfc6c781697a660e95b052 (patch)
tree3fc91815ca139ef2e0b281bba0abda4ef15175f4 /vendor/libghostty-vt/nix/package.nix
parent55c138263e190a1e79d4b997bfb9397306c0ec1f (diff)
feat: finish ghostty pane backend integration
Diffstat (limited to 'vendor/libghostty-vt/nix/package.nix')
-rw-r--r--vendor/libghostty-vt/nix/package.nix141
1 files changed, 141 insertions, 0 deletions
diff --git a/vendor/libghostty-vt/nix/package.nix b/vendor/libghostty-vt/nix/package.nix
new file mode 100644
index 00000000..8287b088
--- /dev/null
+++ b/vendor/libghostty-vt/nix/package.nix
@@ -0,0 +1,141 @@
+{
+ lib,
+ stdenv,
+ callPackage,
+ gobject-introspection,
+ blueprint-compiler,
+ libxml2,
+ gettext,
+ wrapGAppsHook4,
+ git,
+ ncurses,
+ pkg-config,
+ zig_0_15,
+ pandoc,
+ revision ? "dirty",
+ optimize ? "Debug",
+ enableX11 ? true,
+ enableWayland ? true,
+ wayland-protocols,
+ wayland-scanner,
+ pkgs,
+}: let
+ gi_typelib_path = import ./build-support/gi-typelib-path.nix {
+ inherit pkgs lib stdenv;
+ };
+ buildInputs = import ./build-support/build-inputs.nix {
+ inherit pkgs lib stdenv enableX11 enableWayland;
+ };
+ strip = optimize != "Debug" && optimize != "ReleaseSafe";
+in
+ stdenv.mkDerivation (finalAttrs: {
+ pname = "ghostty";
+ version = "1.3.2-dev";
+
+ # We limit source like this to try and reduce the amount of rebuilds as possible
+ # thus we only provide the source that is needed for the build
+ #
+ # NOTE: as of the current moment only linux files are provided,
+ # since darwin support is not finished
+ src = lib.fileset.toSource {
+ root = ../.;
+ fileset = lib.fileset.intersection (lib.fileset.fromSource (lib.sources.cleanSource ../.)) (
+ lib.fileset.unions [
+ ../dist/linux
+ ../images
+ ../include
+ ../po
+ ../pkg
+ ../src
+ ../vendor
+ ../build.zig
+ ../build.zig.zon
+ ../build.zig.zon.nix
+ ]
+ );
+ };
+
+ deps = callPackage ../build.zig.zon.nix {name = "ghostty-cache-${finalAttrs.version}";};
+
+ nativeBuildInputs =
+ [
+ git
+ ncurses
+ pandoc
+ pkg-config
+ zig_0_15
+ gobject-introspection
+ wrapGAppsHook4
+ blueprint-compiler
+ libxml2 # for xmllint
+ gettext
+ ]
+ ++ lib.optionals enableWayland [
+ wayland-scanner
+ wayland-protocols
+ ];
+
+ buildInputs = buildInputs;
+
+ dontStrip = !strip;
+
+ GI_TYPELIB_PATH = gi_typelib_path;
+
+ dontSetZigDefaultFlags = true;
+
+ zigBuildFlags = [
+ "--system"
+ "${finalAttrs.deps}"
+ "-Dversion-string=${finalAttrs.version}-${revision}-nix"
+ "-Dgtk-x11=${lib.boolToString enableX11}"
+ "-Dgtk-wayland=${lib.boolToString enableWayland}"
+ "-Dcpu=baseline"
+ "-Doptimize=${optimize}"
+ "-Dstrip=${lib.boolToString strip}"
+ ];
+
+ outputs = [
+ "out"
+ "terminfo"
+ "shell_integration"
+ "vim"
+ ];
+
+ postInstall = ''
+ terminfo_src=${
+ if stdenv.hostPlatform.isDarwin
+ then ''"$out/Applications/Ghostty.app/Contents/Resources/terminfo"''
+ else "$out/share/terminfo"
+ }
+
+ mkdir -p "$out/nix-support"
+
+ mkdir -p "$terminfo/share"
+ mv "$terminfo_src" "$terminfo/share/terminfo"
+ ln -sf "$terminfo/share/terminfo" "$terminfo_src"
+ echo "$terminfo" >> "$out/nix-support/propagated-user-env-packages"
+
+ mkdir -p "$shell_integration"
+ mv "$out/share/ghostty/shell-integration" "$shell_integration/shell-integration"
+ ln -sf "$shell_integration/shell-integration" "$out/share/ghostty/shell-integration"
+ echo "$shell_integration" >> "$out/nix-support/propagated-user-env-packages"
+
+ mv $out/share/vim/vimfiles "$vim"
+ ln -sf "$vim" "$out/share/vim/vimfiles"
+ echo "$vim" >> "$out/nix-support/propagated-user-env-packages"
+
+ echo "gst_all_1.gstreamer" >> "$out/nix-support/propagated-user-env-packages"
+ echo "gst_all_1.gst-plugins-base" >> "$out/nix-support/propagated-user-env-packages"
+ echo "gst_all_1.gst-plugins-good" >> "$out/nix-support/propagated-user-env-packages"
+ '';
+
+ meta = {
+ homepage = "https://ghostty.org";
+ license = lib.licenses.mit;
+ platforms = [
+ "x86_64-linux"
+ "aarch64-linux"
+ ];
+ mainProgram = "ghostty";
+ };
+ })