kitty: fix diff.conf being generated regardless of user config
'cfg.diffConfig' is an implicit submodule with sub-options that carry
their own defaults, so it never actually equals `{ }` - the previous
`cfg.diffConfig != { }` check was always true. This caused
'kitty/diff.conf' to be written (and clobber any existing unmanaged file)
even when the user configured nothing under `programs.kitty.diffConfig`.
This commit is contained in:
parent
0992a29487
commit
564bc37de5
4 changed files with 29 additions and 1 deletions
|
|
@ -5,4 +5,5 @@
|
|||
kitty-example-mkOrder = ./example-mkOrder.nix;
|
||||
kitty-example-quickAccessTerminalConfig = ./example-quickAccessTerminalConfig.nix;
|
||||
kitty-auto-theme-files = ./auto-theme-files.nix;
|
||||
kitty-example-diffConfig = ./example-diffConfig.nix;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
# Generated by Home Manager
|
||||
# See https://sw.kovidgoyal.net/kitty/kittens/diff/
|
||||
diff_cmd auto
|
||||
|
||||
map j scroll_by 1
|
||||
|
||||
21
tests/modules/programs/kitty/example-diffConfig.nix
Normal file
21
tests/modules/programs/kitty/example-diffConfig.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
config = {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
|
||||
diffConfig = {
|
||||
settings.diff_cmd = "auto";
|
||||
keybindings = {
|
||||
"j" = "scroll_by 1";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/kitty/diff.conf
|
||||
assertFileContent \
|
||||
home-files/.config/kitty/diff.conf \
|
||||
${./example-diffConfig-expected.conf}
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue