scooter  ·  2026-04-15

flake.nix

 1{
 2  description = "pgit - static site generator for git repositories";
 3
 4  inputs = {
 5    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
 6    flake-utils.url = "github:numtide/flake-utils";
 7  };
 8
 9  outputs = { self, nixpkgs, flake-utils }:
10    flake-utils.lib.eachDefaultSystem (system:
11      let
12        pkgs = nixpkgs.legacyPackages.${system};
13
14        # Read the version from go.mod or use a default
15        version = "0.1.0";
16      in
17      {
18        packages.default = pkgs.buildGoModule {
19          pname = "pgit";
20          inherit version;
21          src = ./.;
22
23          # This hash will need to be updated based on go.sum
24          # Run 'nix build' and it will fail with the expected hash
25          vendorHash = "sha256-95H+k3LHaB6WjnLpwjviCopwfO9MKbyiVKB5HWyNZgE=";
26
27          subPackages = [ "cmd/pgit" "cmd/pgit-index" ];
28
29          meta = with pkgs.lib; {
30            description = "Static site generator for git repositories";
31            homepage = "https://code.kilimanjaro.io/pgit";
32            license = licenses.gpl3Only;
33            mainProgram = "pgit";
34          };
35        };
36
37        devShells.default = pkgs.mkShell {
38          buildInputs = with pkgs; [
39            go
40            git
41            gopls
42            golangci-lint
43          ];
44        };
45      });
46}