beads icon indicating copy to clipboard operation
beads copied to clipboard

feat: comprehensive NixOS support improvements

Open bcotton opened this issue 1 month ago • 1 comments

This commit adds full NixOS support and automates Nix package maintenance:

Static Linux Binaries for NixOS

Changes .goreleaser.yml to create static Linux binaries:

  • Set CGO_ENABLED=0 for Linux amd64 and arm64 builds
  • Remove cross-compiler dependencies (aarch64-linux-gnu-gcc)
  • Simplifies build process while fixing NixOS compatibility

Static binaries work on all Linux distributions including NixOS, Alpine, and musl-based distros without dynamic linker dependencies.

Automated default.nix Version Management

Adds default.nix to the version bump workflow:

  • Updates default.nix version field in bump-version.sh (new step 9)
  • Adds default.nix to version verification checks
  • Prevents version drift (was 5 releases behind: 0.42.0 vs 0.47.0)
  • Updates README.md to remove glibc 2.32+ requirement

Automated vendorHash Management

Creates scripts/update-nix-vendorhash.sh to automate vendorHash updates:

  • Automatically detects correct hash by triggering Nix build error
  • Extracts hash from error message and updates default.nix
  • Verifies update with clean build
  • Eliminates error-prone manual copy-paste workflow
  • Works with local Nix OR Docker (uses nixos/nix image automatically)

Integrates vendorHash check into bump-version.sh:

  • Detects when go.mod or go.sum have changed
  • Prompts to run vendorHash update script interactively
  • Catches synchronization issues at release time

Documentation

Updates AGENTS.md with Nix package maintenance guide:

  • Documents when and how to update vendorHash
  • Recommends automated script as primary method
  • Provides manual and alternative methods as fallback
  • Notes Docker fallback for maintainers without Nix

Impact

  • NixOS users can now install via standard methods
  • Nix package version stays synchronized automatically
  • vendorHash updates work without Nix installed (via Docker)
  • vendorHash updates are caught during release workflow
  • All Linux users benefit from more portable binaries

bcotton avatar Jan 12 '26 00:01 bcotton

Thanks for the detailed review! I've addressed all three issues:

✅ Fixed Issues

  1. Undefined log_ functions* - Replaced all log_warning(), log_info(), log_success(), and log_error() calls with the existing echo pattern using ${YELLOW}, ${GREEN}, and ${RED} colors (consistent with the rest of bump-version.sh)

  2. Version drift - Updated default.nix version from 0.42.0 to 0.47.0 to match cmd/bd/version.go

  3. AGENTS.md architecture - Removed the Nix Package Maintenance section (48 lines) to keep AGENTS.md minimal per beads' dynamic priming design

All changes committed in 88cafd1c and ready for re-review.

bcotton avatar Jan 12 '26 23:01 bcotton