Commit graph

16 commits

Author SHA1 Message Date
matt wilkie
e9ebb2bc4d Fix Nix CI Go toolchain selection (bd-7mh.6) 2026-04-28 07:00:35 -07:00
matt wilkie
ae0fc1dd63
fix(nix): use proxy vendor for pure-go package
Build the Nix package with the existing gms_pure_go tag while using proxyVendor to avoid stale vendor/modules.txt consistency checks. Remove leftover ICU flake wiring and the debug env dump from postPatch.

Based on the focused Nix changes from #3278; contributor attribution preserved in c9fa7cf8b.

Closes bd-9ok
2026-04-25 15:02:28 -07:00
m4dc4p
8ec8f705b1
Update nix install for v1.0.0 (#3064)
* Beads / dolt requires ICU libraries and headers for https://github.com/dolthub/go-icu-regex - added
* Refactor nix slightly for ergonomics.
* Remove unnecessary overlay
2026-04-07 20:07:07 -07:00
Graeme Foster
f320e3cc13
fix(flake): override go_1_25 and fix vendorHash
The overlay must target go_1_25 (not go) because buildGoModule
references go_1_25 directly on nixos-25.11.

Also update vendorHash from placeholder to correct value so
nix build produces a working bd binary.
2026-03-13 19:24:43 +00:00
Graeme Foster
66079fdcfe
fix(flake): overlay Go 1.25.8 for devShell compatibility
go.mod requires Go 1.25.8 but nixpkgs (nixos-25.11) ships 1.25.7,
so `nix develop` produces a Go toolchain that refuses to build bd.

Add a Go overlay to bump the version. The overlay can be removed
once nixpkgs ships Go >= 1.25.8.
2026-03-13 18:46:32 +00:00
beads/crew/collins
7f41edd9c4 feat(nix): modernize flake for nixpkgs-25.11, fix-merge PR #2314
Switch from nixpkgs-unstable to nixpkgs-25.11 which has Go 1.25.6.
Drop flake-utils in favor of inline forAllSystems helper (modern convention).
Refactor default.nix to follow callPackage conventions (explicit deps).
Extract packages.nix for cleaner separation.

Adjustments from original PR:
- Removed unnecessary icu/pkg-config deps (no CGO/ICU usage in beads)
- Removed commented-out dead overlay code
- Preserved shell completion sub-packages (fish/bash/zsh)

Closes #2314

Co-Authored-By: Nick Zadrozny <nz@omc.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 17:24:10 -08:00
Patrick Farrell
51dc5ffed6 feat: add 'beads' alias for bd command during installation
Add a 'beads' symlink/alias that points to the 'bd' binary across all
installation methods, allowing users to invoke the tool using either
'bd' or 'beads'.

Changes:
- Makefile: Create 'beads' symlink in install target
- scripts/install.sh: Add create_beads_alias function, call it in all
  three installation paths (release download, go install, build from source)
- flake.nix: Add 'beads' symlink in Nix package installPhase
- install.ps1: Add Create-BeadsAlias function for Windows (creates a copy
  since symlinks require admin privileges)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 15:19:00 +00:00
Johannes Schickling
3daec76ac9
fix(nix): bake shell completions into default package (#1229)
The default package now includes fish, bash, and zsh completions
at standard paths. This means users only need to install the
default package to get both the binary and completions.

The separate completion packages are kept for backwards
compatibility but now simply symlink to the default package.

Standard completion paths:
- share/fish/vendor_completions.d/bd.fish
- share/bash-completion/completions/bd
- share/zsh/site-functions/_bd
2026-01-21 19:11:21 -08:00
Johannes Schickling
e36e2f6679
feat(nix): add shell completion outputs to flake (#1210)
Add fish, bash, and zsh completion packages to the Nix flake.
Completions are generated at build time using `bd completion <shell>`.

Usage:
  nix build .#fish-completions
  nix build .#bash-completions
  nix build .#zsh-completions

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 14:05:44 -08:00
Darin
e0734e230f
fix: NixOS symlink compatibility for mtime and permission checks (#459)
* fix: use os.Lstat for symlink-safe mtime and permission checks

On NixOS and other systems using symlinks heavily (e.g., home-manager),
os.Stat follows symlinks and returns the target's metadata. This causes:

1. False staleness detection when JSONL is symlinked - mtime of target
   changes unpredictably when symlinks are recreated
2. os.Chmod failing or changing wrong file's permissions when target
   is in read-only location (e.g., /nix/store)
3. os.Chtimes modifying target's times instead of the symlink itself

Changes:
- autoimport.go: Use Lstat for JSONL mtime in CheckStaleness()
- import.go: Use Lstat in TouchDatabaseFile() for JSONL mtime
- export.go: Skip chmod for symlinked files
- multirepo.go: Use Lstat for JSONL mtime cache
- multirepo_export.go: Use Lstat for mtime, skip chmod for symlinks
- doctor/fix/permissions.go: Skip permission fixes for symlinked paths

These changes are safe cross-platform:
- On systems without symlinks, Lstat behaves identically to Stat
- Symlink permission bits are ignored on Unix anyway
- The extra Lstat syscall overhead is negligible

Fixes symlink-related data loss on NixOS. See GitHub issue #379.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* test: add symlink behavior tests for NixOS compatibility

Add tests that verify symlink handling behavior:
- TestCheckStaleness_SymlinkedJSONL: verifies mtime detection uses
  symlink's own mtime (os.Lstat), not target's mtime (os.Stat)
- TestPermissions_SkipsSymlinkedBeadsDir: verifies chmod is skipped
  for symlinked .beads directories
- TestPermissions_SkipsSymlinkedDatabase: verifies chmod is skipped
  for symlinked database files while still fixing .beads dir perms

Also adds devShell to flake.nix for local development with go, gopls,
golangci-lint, and sqlite tools.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-05 13:22:09 -08:00
Zoe Gagnon
474f62c6f2 Fix regression in Nix Flake
In PR #105, a regression was introduced into the nix flake
which disabled consumers from access the package.

This pr fixes that regression.

Additionally adds a nix smoke test for a backstop against this in the future
2025-10-22 22:24:23 -04:00
Zoe Gagnon
fb2881c47b
Break out nix package definition into a default.nix (#105)
* Fix autostart test to work in nix sandbox

* Break out a default.nix to make consuming this package easier

The flake is great for local development, but creates overhead and
duplication when pulling it in on another machine. With the default.nix,
the flake continues to work as before, but consumers can callPackage directly
with their own nixpkgs.

* Break out a default.nix to make consuming this package easier

The flake is great for local development, but creates overhead and
duplication when pulling it in on another machine. With the default.nix,
the flake continues to work as before, but consumers can callPackage directly
with their own nixpkgs.
2025-10-22 11:30:57 -07:00
Sophie Smithburg
34b5863f39
fix: Update Nix flake vendorHash for Go dependencies (#68)
The vendorHash in the flake was outdated, causing build failures.
Updated to match current Go module dependencies.

Also bumped version to 0.9.9 to match current project version.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-17 15:16:53 -07:00
Steve Yegge
1ce8be6f58 Update flake version to 0.9.6 to match project version 2025-10-15 11:50:13 -07:00
Willi Ballenthin
84ba574dff feat: Add apps.default output to flake for nix run support
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 . -- <command>

Tested with 'nix run . -- version' which correctly executes bd.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-15 13:45:05 +02:00
Willi Ballenthin
e89cfbf473 feat: Add Nix flake for declarative builds
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 <noreply@anthropic.com>

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.
2025-10-15 13:45:05 +02:00