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
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>
* 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>
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
* 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.
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>
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>
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.