Something went wrong. Try again.
A history browser for git, a replacement for gitk, drawn with Vulkan on Wayland.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114# SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie <jeff@ocjtech.us># SPDX-License-Identifier: MIT
{ description = "grebe: a history browser for git, a replacement for gitk";
inputs = { nixpkgs = { url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"; }; # Turns build.zig.zon into build.zig.zon.nix, so that the package's Zig # dependencies are fetched by Nix rather than by a sandboxed `zig build`. zon2nix = { url = "git+https://git.jcollie.dev/jeff/zon2nix.git"; inputs.nixpkgs.follows = "nixpkgs"; }; };
outputs = { self, nixpkgs, zon2nix, ... }: let inherit (nixpkgs) lib; # Linux only: Wayland is the one platform grebe is built on. Windows' # build is cross-compiled from here, as the `msi` package. linuxSystems = builtins.filter ( system: (lib.systems.elaborate system).isLinux ) lib.systems.flakeExposed; makePackages = system: import nixpkgs { inherit system; }; forAllSystems = lib.genAttrs linuxSystems; in { packages = forAllSystems ( system: let pkgs = makePackages system; in rec { grebe = pkgs.callPackage ./package.nix { }; default = grebe; # The Windows installer, cross-compiled. msi = pkgs.callPackage ./msi.nix { inherit grebe; }; # The Zig dependencies on their own, for a job that runs `zig build` # for something other than the package. zig-deps = pkgs.callPackage ./build.zig.zon.nix { }; } );
# A NixOS virtual machine with grebe on a headless sway; `nix flake # check` runs it, and it needs KVM. checks = lib.genAttrs [ "x86_64-linux" ] ( system: let pkgs = makePackages system; grebe = self.packages.${system}.grebe; in { inherit grebe; vm = pkgs.testers.runNixOSTest (import ./tests/nixos/grebe.nix { inherit grebe pkgs; }); } );
devShells = forAllSystems ( system: let pkgs = makePackages system; in { default = pkgs.mkShell { name = "grebe"; # The Vulkan loader is opened at run time, and the validation # layer is found through its manifest. LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.vulkan-loader ]; VK_ADD_LAYER_PATH = "${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d"; nativeBuildInputs = [ pkgs.zig_0_17 # The tests build repositories to read with it. pkgs.git pkgs.vulkan-loader pkgs.vulkan-validation-layers pkgs.vulkan-tools pkgs.git-pages-cli pkgs.reuse # Regenerates build.zig.zon.nix: # zon2nix --17 --nix=build.zig.zon.nix build.zig.zon # It runs `zig env`, so it is wrapped to find this Zig. (pkgs.symlinkJoin { name = "zon2nix"; paths = [ zon2nix.packages.${system}.zon2nix ]; nativeBuildInputs = [ pkgs.makeWrapper ]; postBuild = '' wrapProgram $out/bin/zon2nix \ --prefix PATH : ${lib.makeBinPath [ pkgs.zig_0_17 ]} ''; }) ] ++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [ pkgs.kcov pkgs.perf ]; }; } ); };}