Files
home-manager/tests/modules/programs/difftastic/difftastic-migration.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

32 lines
1.1 KiB
Nix

{
lib,
options,
...
}:
{
programs.git = {
enable = true;
difftastic = {
enable = true;
options = {
color = "always";
display = "side-by-side";
};
};
};
test.asserts.warnings.expected = [
"The option `programs.git.difftastic.options' defined in ${lib.showFiles options.programs.git.difftastic.options.files} has been renamed to `programs.difftastic.options'."
"The option `programs.git.difftastic.enable' defined in ${lib.showFiles options.programs.git.difftastic.enable.files} has been renamed to `programs.difftastic.enable'."
"`programs.difftastic.git.enable` automatic enablement is deprecated. Please explicitly set `programs.difftastic.git.enable = true`."
];
nmt.script = ''
# Git config should contain difftastic configuration (backward compatibility)
assertFileExists home-files/.config/git/config
assertFileContains home-files/.config/git/config '[diff]'
assertFileContains home-files/.config/git/config "external = \"@difftastic@/bin/difft '--color=always' '--display=side-by-side'\""
'';
}