mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 09:29:41 +08:00
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>
26 lines
773 B
Nix
26 lines
773 B
Nix
{
|
|
programs.difftastic = {
|
|
enable = true;
|
|
git = {
|
|
enable = true;
|
|
diffToolMode = false;
|
|
};
|
|
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 diff.external set
|
|
assertFileContains home-files/.config/git/config "external = \"@difftastic@/bin/difft '--color=always' '--display=side-by-side'\""
|
|
# 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"\]'
|
|
'';
|
|
}
|