mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-31 09:10:11 +00:00
Setting `core.pager` may result in issues like swallowed `git grep` results. To avoid this, apply pagers to specific commands where we expect `diff`-ish output only. Use a common helper to set pager for all modules that configure it.
23 lines
716 B
Nix
23 lines
716 B
Nix
{
|
|
programs.diff-highlight = {
|
|
enable = true;
|
|
enableGitIntegration = true;
|
|
pagerOpts = [
|
|
"--tabs=4"
|
|
"-RFX"
|
|
];
|
|
};
|
|
|
|
programs.git.enable = true;
|
|
|
|
nmt.script = ''
|
|
assertFileExists home-files/.config/git/config
|
|
assertFileContains home-files/.config/git/config '[pager]'
|
|
assertFileRegex home-files/.config/git/config 'diff = .*/diff-highlight.*less'
|
|
assertFileRegex home-files/.config/git/config 'log = .*/diff-highlight.*less'
|
|
assertFileRegex home-files/.config/git/config 'show = .*/diff-highlight.*less'
|
|
assertFileContains home-files/.config/git/config '[interactive]'
|
|
assertFileRegex home-files/.config/git/config 'diffFilter = .*/diff-highlight'
|
|
'';
|
|
}
|