feat: comprehensive NixOS support improvements (#1024)
* feat: comprehensive NixOS support improvements 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 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: address PR review feedback for NixOS support Fixes three issues identified in PR review: 1. Replace undefined log_* functions in bump-version.sh with existing echo pattern (log_warning, log_info, log_success, log_error were called but not defined) 2. Update default.nix version from 0.42.0 to 0.47.0 to fix version drift with cmd/bd/version.go 3. Remove Nix Package Maintenance section from AGENTS.md per beads architecture (use bd prime for dynamic context, keep AGENTS.md minimal) * fix: update versions to 0.47.1 after merge with main - Update claude-plugin plugin.json to 0.47.1 - Update default.nix to 0.47.1 - Fixes version check failures after merging latest main branch --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -305,6 +305,60 @@ main() {
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if go.mod or go.sum changed since last commit
|
||||
if git diff HEAD go.mod go.sum 2>/dev/null | grep -q .; then
|
||||
echo ""
|
||||
echo -e "${YELLOW}Warning: go.mod or go.sum has uncommitted changes${NC}"
|
||||
echo "You may need to update vendorHash in default.nix"
|
||||
echo ""
|
||||
read -p "Run ./scripts/update-nix-vendorhash.sh now? [y/N] " -n 1 -r
|
||||
echo ""
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
if [ -f "./scripts/update-nix-vendorhash.sh" ]; then
|
||||
echo "Running vendorHash update script..."
|
||||
if ./scripts/update-nix-vendorhash.sh; then
|
||||
echo -e "${GREEN}✓ vendorHash updated successfully${NC}"
|
||||
else
|
||||
echo -e "${YELLOW}⚠ vendorHash update failed or was skipped${NC}"
|
||||
fi
|
||||
echo ""
|
||||
else
|
||||
echo -e "${RED}Error: scripts/update-nix-vendorhash.sh not found${NC}"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Skipping vendorHash update"
|
||||
echo "Run ./scripts/update-nix-vendorhash.sh manually if needed"
|
||||
echo ""
|
||||
fi
|
||||
elif git diff HEAD~1..HEAD go.mod go.sum 2>/dev/null | grep -q .; then
|
||||
# Check if go.mod/go.sum changed in the last commit
|
||||
echo ""
|
||||
echo -e "${YELLOW}Warning: go.mod or go.sum changed in the last commit${NC}"
|
||||
echo "You may need to update vendorHash in default.nix"
|
||||
echo ""
|
||||
read -p "Run ./scripts/update-nix-vendorhash.sh now? [y/N] " -n 1 -r
|
||||
echo ""
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
if [ -f "./scripts/update-nix-vendorhash.sh" ]; then
|
||||
echo "Running vendorHash update script..."
|
||||
if ./scripts/update-nix-vendorhash.sh; then
|
||||
echo -e "${GREEN}✓ vendorHash updated successfully${NC}"
|
||||
else
|
||||
echo -e "${YELLOW}⚠ vendorHash update failed or was skipped${NC}"
|
||||
fi
|
||||
echo ""
|
||||
else
|
||||
echo -e "${RED}Error: scripts/update-nix-vendorhash.sh not found${NC}"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Skipping vendorHash update"
|
||||
echo "Run ./scripts/update-nix-vendorhash.sh manually if needed"
|
||||
echo ""
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Updating version files..."
|
||||
|
||||
# 1. Update cmd/bd/version.go
|
||||
@@ -357,7 +411,13 @@ main() {
|
||||
"\"version\": \"$CURRENT_VERSION\"" \
|
||||
"\"version\": \"$NEW_VERSION\""
|
||||
|
||||
# 9. Update hook templates
|
||||
# 9. Update default.nix (Nix package definition)
|
||||
echo " • default.nix"
|
||||
update_file "default.nix" \
|
||||
"version = \"$CURRENT_VERSION\";" \
|
||||
"version = \"$NEW_VERSION\";"
|
||||
|
||||
# 10. Update hook templates
|
||||
echo " • cmd/bd/templates/hooks/*"
|
||||
HOOK_FILES=("pre-commit" "post-merge" "pre-push" "post-checkout")
|
||||
for hook in "${HOOK_FILES[@]}"; do
|
||||
@@ -366,7 +426,7 @@ main() {
|
||||
"# bd-hooks-version: $NEW_VERSION"
|
||||
done
|
||||
|
||||
# 10. Update CHANGELOG.md
|
||||
# 11. Update CHANGELOG.md
|
||||
echo " • CHANGELOG.md"
|
||||
update_changelog "$NEW_VERSION"
|
||||
|
||||
@@ -389,6 +449,7 @@ main() {
|
||||
"$(grep '__version__ = ' integrations/beads-mcp/src/beads_mcp/__init__.py | sed 's/.*"\(.*\)".*/\1/')"
|
||||
"$(jq -r '.version' npm-package/package.json)"
|
||||
"$(grep '# bd-hooks-version: ' cmd/bd/templates/hooks/pre-commit | sed 's/.*: \(.*\)/\1/')"
|
||||
"$(grep 'version = ' default.nix | sed 's/.*"\(.*\)".*/\1/')"
|
||||
)
|
||||
|
||||
ALL_MATCH=true
|
||||
|
||||
Reference in New Issue
Block a user