2.home-manager/tests/modules/programs/difftastic/difftastic-with-git-external-diff.nix
Ondřej Kvapil f3a30376bb
Some checks failed
/ triage (push) Has been cancelled
GitHub Pages / publish (ubuntu-latest) (push) Has been cancelled
difftastic: allow repeating options
The type was overly restrictive, see
https://github.com/nix-community/home-manager/pull/7947/changes#r2858054388
2026-02-27 19:59:12 +01:00

29 lines
909 B
Nix

{
programs.difftastic = {
enable = true;
git = {
enable = true;
diffToolMode = false;
};
options = {
color = "always";
display = "side-by-side";
override = [
"*.mill:Scala"
"*.yuck:Emacs Lisp"
];
};
};
programs.git.enable = true;
nmt.script = ''
assertFileExists home-files/.config/git/config
assertFileContains home-files/.config/git/config '[diff]'
# Should have diff.external set
assertFileContains home-files/.config/git/config "external = \"@difftastic@/bin/difft '--color=always' '--display=side-by-side' '--override=*.mill:Scala' '--override=*.yuck:Emacs Lisp'\""
# Should NOT have difftool config when diffToolMode is explicitly false
assertFileNotRegex home-files/.config/git/config 'tool = "difftastic"'
assertFileNotRegex home-files/.config/git/config '\[difftool "difftastic"\]'
'';
}