Files
home-manager/tests/modules/programs/b4/settings.nix
Farid Zakaria 2ba72d0237 b4: add module
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)
2026-09-12 22:36:06 -05:00

30 lines
963 B
Nix

{
# settings lands in the [b4] section and coexists with the ordered-list form
# of programs.git.settings, which a `programs.git.settings.b4` definition
# would conflict with.
programs.git = {
enable = true;
settings = [
{ core.whitespace = "trailing-space,space-before-tab"; }
];
};
programs.b4 = {
enable = true;
settings = {
attestation-policy = "hardfail";
midmask = "https://lore.kernel.org/all/%s";
};
};
nmt.script = ''
assertFileExists home-files/.config/git/config
assertFileContains home-files/.config/git/config '[b4]'
assertFileContains home-files/.config/git/config 'attestation-policy = "hardfail"'
assertFileContains home-files/.config/git/config 'midmask = "https://lore.kernel.org/all/%s"'
assertFileContains home-files/.config/git/config '[core]'
assertFileContains home-files/.config/git/config \
'whitespace = "trailing-space,space-before-tab"'
'';
}