mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
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:
committed by
Matthieu Coudron
parent
2a39b0828b
commit
f3a30376bb
@@ -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"\]'
|
||||
|
||||
Reference in New Issue
Block a user