Files
pad/flake.nix
T
Claude 02b302519e feat(nix): add flake packaging for pad with CI build
Adds a Nix flake exposing the pad binary as packages.default (buildGoModule
+ importNpmLock for the embedded SvelteKit UI), a devShell, and flake
checks (package build with `go test ./...`, plus a `pad --version` smoke
test). nix/package.nix is written nixpkgs-submission-ready (no
flake-specific inputs) so it can later be adapted for pkgs/by-name.

Also adds a GitHub Actions workflow that runs `nix flake check` and
`nix build` on push/PR, and documents `nix run` / `nix profile install`
/ `nix develop` in the README.
2026-07-26 22:49:10 +00:00

55 lines
1.4 KiB
Nix

{
description = "Pad local-first project management for developers and AI agents";
inputs.nixpkgs.url = "https://channels.nixos.org/nixos-26.05/nixexprs.tar.xz";
outputs =
{ self, nixpkgs }:
let
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
in
{
packages = forAllSystems (pkgs: {
default = pkgs.callPackage ./nix/package.nix { };
pad = pkgs.callPackage ./nix/package.nix { };
});
apps = forAllSystems (pkgs: {
default = {
type = "app";
program = "${self.packages.${pkgs.system}.default}/bin/pad";
};
});
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
go_1_26
nodejs_24
golangci-lint
sqlite
gopls
];
shellHook = ''
echo "pad dev shell: $(go version), node $(node --version)"
'';
};
});
checks = forAllSystems (pkgs: {
default = self.packages.${pkgs.system}.default;
version-smoke = pkgs.runCommand "pad-version-smoke" { } ''
${self.packages.${pkgs.system}.default}/bin/pad --version
touch $out
'';
});
};
}