modules/homebrew: add shell integration options

Add `enableBashIntegration`, `enableFishIntegration`, and
`enableZshIntegration` options that evaluate `brew shellenv` to set up
Homebrew's environment and shell completions. This automates the
boilerplate that every nix-darwin Homebrew user currently writes manually.

All three shells use `interactiveShellInit`, consistent with direnv and
home-manager conventions. Fish additionally sets up completions paths in
the same hook.
This commit is contained in:
Malo Bourgon 2026-02-10 00:06:24 -08:00
parent 8c29e146dd
commit ca6f8609c3
No known key found for this signature in database
4 changed files with 72 additions and 0 deletions

View file

@ -125,5 +125,8 @@ in
echo "checking vscode entries in Brewfile" >&2
${mkTest "golang.go" ''vscode "golang.go"''}
echo "checking that shell integration is absent by default" >&2
(! grep 'brew shellenv' ${config.out}/etc/zshrc)
'';
}