mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-03 12:09:19 +00:00
b4 (https://b4.docs.kernel.org) is a tool for kernel-style patch and email review workflows on lore.kernel.org. The module installs b4 and writes its configuration to git-config's [b4] section -- b4 has no config file of its own -- defaulting to a recommended Claude Code review-agent wiring. The review-editor highlighting and agent-reviewer prompt b4 ships under misc/ are missing from its PyPI sdist; the module pulls them from the nixpkgs packages added in NixOS/nixpkgs#543347 rather than fetching the b4 repository itself. Assisted-By: Claude Opus 4.8 (1M context)
25 lines
780 B
Nix
25 lines
780 B
Nix
{ config, ... }:
|
|
{
|
|
# agentReview writes both agent keys, with the instructions directory
|
|
# shell-quoted inside the shlex-split command.
|
|
programs.git.enable = true;
|
|
|
|
programs.b4 = {
|
|
enable = true;
|
|
agentReview = {
|
|
enable = true;
|
|
instructions = "/some dir/agent-reviewer.md";
|
|
};
|
|
};
|
|
|
|
nmt.script = ''
|
|
assertFileExists home-files/.config/git/config
|
|
assertFileContains home-files/.config/git/config '[b4]'
|
|
assertFileContains home-files/.config/git/config \
|
|
"review-agent-command = \"${config.programs.b4.agentReview.command}\""
|
|
assertFileContains home-files/.config/git/config \
|
|
"review-agent-prompt-path = \"/some dir/agent-reviewer.md\""
|
|
assertFileContains home-files/.config/git/config "add-dir '/some dir'"
|
|
'';
|
|
}
|