difftastic: allow repeating options
Some checks failed
/ triage (push) Has been cancelled
GitHub Pages / publish (ubuntu-latest) (push) Has been cancelled

The type was overly restrictive, see
https://github.com/nix-community/home-manager/pull/7947/changes#r2858054388
This commit is contained in:
Ondřej Kvapil 2026-02-26 11:01:07 +01:00 committed by Matthieu Coudron
parent 2a39b0828b
commit f3a30376bb
2 changed files with 13 additions and 6 deletions

View file

@ -67,11 +67,14 @@ in
options = mkOption {
type =
with types;
attrsOf (oneOf [
str
int
bool
]);
let
atom = oneOf [
str
int
bool
];
in
attrsOf (either atom (listOf atom));
default = { };
example = {
color = "dark";

View file

@ -8,6 +8,10 @@
options = {
color = "always";
display = "side-by-side";
override = [
"*.mill:Scala"
"*.yuck:Emacs Lisp"
];
};
};
@ -17,7 +21,7 @@
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'\""
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"\]'