From e89cfbf473786f30bbcef57ec4497a3f41331fda Mon Sep 17 00:00:00 2001 From: Willi Ballenthin Date: Wed, 15 Oct 2025 10:10:17 +0200 Subject: [PATCH 1/4] feat: Add Nix flake for declarative builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add flake.nix with computed vendorHash for Go dependencies. The flake supports all major platforms (x86_64/aarch64 Linux and macOS) and builds the bd binary from cmd/bd. Removed unnecessary postInstall section as buildGoModule already names the binary correctly from subPackages. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude perf: Use self input instead of ./. for faster Nix evaluation Replace src = ./. with src = self in flake.nix to reduce unnecessary file copying during evaluation. This eliminates the Nix warning about evaluation performance. --- flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 42 +++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..5cc6d190 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1760284886, + "narHash": "sha256-TK9Kr0BYBQ/1P5kAsnNQhmWWKgmZXwUQr4ZMjCzWf2c=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "cf3f5c4def3c7b5f1fc012b3d839575dbe552d43", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..fb648e1e --- /dev/null +++ b/flake.nix @@ -0,0 +1,42 @@ +{ + description = "beads (bd) - An issue tracker designed for AI-supervised coding workflows"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachSystem [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ] (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + packages.default = pkgs.buildGoModule { + pname = "beads"; + version = "0.9.5"; + + src = self; + + # Point to the main Go package + subPackages = [ "cmd/bd" ]; + + # Go module dependencies hash (computed via nix build) + vendorHash = "sha256-WvwT48izxMxx9qQmZp/6zwv7hHgTVd9KmOJFm7RWvrI="; + + meta = with pkgs.lib; { + description = "beads (bd) - An issue tracker designed for AI-supervised coding workflows"; + homepage = "https://github.com/steveyegge/beads"; + license = licenses.mit; + mainProgram = "bd"; + maintainers = [ ]; + }; + }; + } + ); +} From 84ba574dff487a0c750e2d623ee3cfddb6b1a741 Mon Sep 17 00:00:00 2001 From: Willi Ballenthin Date: Wed, 15 Oct 2025 10:12:00 +0200 Subject: [PATCH 2/4] feat: Add apps.default output to flake for nix run support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an apps.default output to the Nix flake that enables running bd directly with 'nix run .' without needing to use the full package path. The apps output references the built bd binary from packages.default, allowing users to easily run the tool with: nix run . -- Tested with 'nix run . -- version' which correctly executes bd. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- flake.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flake.nix b/flake.nix index fb648e1e..7bcd53d9 100644 --- a/flake.nix +++ b/flake.nix @@ -37,6 +37,11 @@ maintainers = [ ]; }; }; + + apps.default = { + type = "app"; + program = "${self.packages.${system}.default}/bin/bd"; + }; } ); } From 6a3edefad385966a34716b08b87235ed449c1ca3 Mon Sep 17 00:00:00 2001 From: Willi Ballenthin Date: Wed, 15 Oct 2025 10:24:39 +0200 Subject: [PATCH 3/4] docs: Update CHANGELOG with Nix flake support docs: Add nix run example to CHANGELOG --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2217598e..a716012b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added +- **Nix Flake Support**: Declarative builds and installation via Nix + - Multi-platform support (x86_64/aarch64 for Linux and macOS) + - `nix build` to build the bd binary + - `nix run` support for running bd directly without installation + - Example flake input: `inputs.beads.url = "github:steveyegge/beads"` + - Example usage: `nix run github:steveyegge/beads -- ready --json` + ## [0.9.2] - 2025-10-14 ### Added From 1ce8be6f58129cf3c807ad1d88532c89c57f5b60 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Wed, 15 Oct 2025 11:50:13 -0700 Subject: [PATCH 4/4] Update flake version to 0.9.6 to match project version --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 7bcd53d9..40d36ba1 100644 --- a/flake.nix +++ b/flake.nix @@ -19,7 +19,7 @@ { packages.default = pkgs.buildGoModule { pname = "beads"; - version = "0.9.5"; + version = "0.9.6"; src = self;