{ description = "Vertical-tab terminal built on libghostty-vt"; inputs = { # Ghostty tracks nixpkgs-unstable to get GTK 4.20 / GNOME 49. We follow # suit so that our zig-gobject bindings (shared with Ghostty) match the # GObject introspection data of the GTK we link against. nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz"; flake-compat = { url = "github:edolstra/flake-compat"; flake = false; }; systems = { url = "github:nix-systems/default"; flake = false; }; # Zig 0.16.0 is not in nixpkgs yet; libghostty-vt requires it. zig = { url = "github:mitchellh/zig-overlay"; inputs = { nixpkgs.follows = "nixpkgs"; flake-compat.follows = "flake-compat"; systems.follows = "systems"; }; }; }; outputs = { self, nixpkgs, zig, systems, ... }: let inherit (nixpkgs) lib legacyPackages; forAllSystems = f: lib.genAttrs (import systems) (system: f legacyPackages.${system} system); in { devShells = forAllSystems (pkgs: system: { default = pkgs.mkShell { name = "vtabs"; nativeBuildInputs = [ zig.packages.${system}."0.16.0" pkgs.pkg-config pkgs.gdb # Used by ./shot.sh to run the app inside a throwaway headless # compositor and screenshot it, so UI can be checked without # touching the developer's real session. pkgs.sway pkgs.grim pkgs.wtype ]; buildInputs = with pkgs; [ # GTK4 + libadwaita, the same native UI stack Ghostty uses on Linux. gtk4 libadwaita glib gobject-introspection pango cairo harfbuzz gdk-pixbuf graphene # Windowing backends GTK links against. wayland libxkbcommon libx11 # Font stack used by Pango for glyph rasterization. fontconfig freetype # Icon themes so the app doesn't render missing-image icons. adwaita-icon-theme hicolor-icon-theme ]; shellHook = '' # GTK needs to find icon themes and schemas at runtime when the app # is launched straight out of the dev shell rather than installed. export XDG_DATA_DIRS="${pkgs.gtk4}/share/gsettings-schemas/${pkgs.gtk4.name}:${pkgs.adwaita-icon-theme}/share:${pkgs.hicolor-icon-theme}/share:$XDG_DATA_DIRS" export GSETTINGS_SCHEMA_DIR="${pkgs.gtk4}/share/gsettings-schemas/${pkgs.gtk4.name}/glib-2.0/schemas" ''; }; }); formatter = forAllSystems (pkgs: _: pkgs.alejandra); }; }