Files
home-manager/tests/modules/programs/difftastic/difftastic-with-git-difftool.nix
Austin Horstman 92394f9dea difftastic: migrate to lib.cli.toCommandLineShellGNU
Migrates from the deprecated toCommandLineShell to toCommandLineShellGNU.

This changes the output format to use GNU-style concatenated options
(--color=always) with shell escaping for git config values. Both formats
were verified to work correctly with difftastic.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-01-08 11:44:04 -05:00

26 lines
888 B
Nix

{
programs.difftastic = {
enable = true;
git = {
enable = true;
diffToolMode = true;
};
options = {
color = "always";
display = "side-by-side";
};
};
programs.git.enable = true;
nmt.script = ''
assertFileExists home-files/.config/git/config
assertFileContains home-files/.config/git/config '[diff]'
# Should have BOTH diff.external AND difftool config when diffToolMode is true
assertFileContains home-files/.config/git/config "external = \"@difftastic@/bin/difft '--color=always' '--display=side-by-side'\""
assertFileContains home-files/.config/git/config 'tool = "difftastic"'
assertFileContains home-files/.config/git/config '[difftool "difftastic"]'
assertFileContains home-files/.config/git/config "cmd = \"@difftastic@/bin/difft '--color=always' '--display=side-by-side' \$LOCAL \$REMOTE\""
'';
}