{ description = "100gex: a Linux client for Superlogical's Rex"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; # Provides libghostty-vt. Keep this rev in step with the Ghostty commit # that go.mitchellh.com/libghostty pins (GIT_TAG in its CMakeLists.txt); # the Go bindings track the C API at that commit. # # Ghostty's package builds with `zig_0_17` from the nixpkgs it is given, # so following our nixpkgs means our lock pins the Zig version too. ghostty = { url = "github:ghostty-org/ghostty/5813c9461d5af78b6307a1254d00b1bc190eaccd"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, ghostty, }: let systems = [ "x86_64-linux" "aarch64-linux" ]; forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system}); in { packages = forAllSystems (pkgs: { inherit (ghostty.packages.${pkgs.stdenv.hostPlatform.system}) libghostty-vt; }); devShells = forAllSystems (pkgs: { default = pkgs.mkShell { packages = with pkgs; [ go gopls pkg-config ]; # C libraries Gio builds against on Linux. buildInputs = with pkgs; [ wayland libxkbcommon libGL vulkan-headers vulkan-loader libx11 libxcursor libxfixes libxcb # Provides libghostty-vt.pc and libghostty-vt-static.pc for cgo. self.packages.${pkgs.stdenv.hostPlatform.system}.libghostty-vt ]; # Gio loads EGL and Vulkan at runtime; make the Nix-provided libraries findable. shellHook = '' export LD_LIBRARY_PATH=${ pkgs.lib.makeLibraryPath ( with pkgs; [ libGL vulkan-loader wayland libxkbcommon libx11 libxcursor libxfixes ] ) }''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} ''; }; }); formatter = forAllSystems (pkgs: pkgs.nixfmt); }; }