difftastic: allow repeating options
The type was overly restrictive, see https://github.com/nix-community/home-manager/pull/7947/changes#r2858054388
This commit is contained in:
parent
2a39b0828b
commit
f3a30376bb
2 changed files with 13 additions and 6 deletions
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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"\]'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue