mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
git: add extraArgs option for difftastic
This option will cover any other arguments that aren't made available with dedicated options.
This commit is contained in:
parent
1652349e57
commit
7d3d323e90
3 changed files with 28 additions and 9 deletions
|
|
@ -377,6 +377,18 @@ in
|
||||||
Determines how the output displays - in one column or two columns.
|
Determines how the output displays - in one column or two columns.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extraArgs = mkOption {
|
||||||
|
type = types.nullOr (types.listOf types.str);
|
||||||
|
default = null;
|
||||||
|
example = [
|
||||||
|
"--tab-width=8"
|
||||||
|
"--sort-paths"
|
||||||
|
];
|
||||||
|
description = ''
|
||||||
|
Extra command line arguments to pass to {command}`difft`.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
delta = {
|
delta = {
|
||||||
|
|
@ -837,13 +849,16 @@ in
|
||||||
|
|
||||||
(
|
(
|
||||||
let
|
let
|
||||||
difftCommand = concatStringsSep " " [
|
difftCommand = concatStringsSep " " (
|
||||||
|
[
|
||||||
"${lib.getExe cfg.difftastic.package}"
|
"${lib.getExe cfg.difftastic.package}"
|
||||||
"--color ${cfg.difftastic.color}"
|
"--color ${cfg.difftastic.color}"
|
||||||
"--background ${cfg.difftastic.background}"
|
"--background ${cfg.difftastic.background}"
|
||||||
"--display ${cfg.difftastic.display}"
|
"--display ${cfg.difftastic.display}"
|
||||||
"--context ${toString cfg.difftastic.context}"
|
"--context ${toString cfg.difftastic.context}"
|
||||||
];
|
]
|
||||||
|
++ (lib.optionals (cfg.difftastic.extraArgs != null) cfg.difftastic.extraArgs)
|
||||||
|
);
|
||||||
in
|
in
|
||||||
(lib.mkMerge [
|
(lib.mkMerge [
|
||||||
(mkIf cfg.difftastic.enable {
|
(mkIf cfg.difftastic.enable {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
[diff]
|
[diff]
|
||||||
external = "@difftastic@/bin/difft --color always --background dark --display inline --context 5"
|
external = "@difftastic@/bin/difft --color always --background dark --display inline --context 5 --tab-width=8 --sort-paths"
|
||||||
tool = "difftastic"
|
tool = "difftastic"
|
||||||
|
|
||||||
[difftool "difftastic"]
|
[difftool "difftastic"]
|
||||||
cmd = "@difftastic@/bin/difft --color always --background dark --display inline --context 5 $LOCAL $REMOTE"
|
cmd = "@difftastic@/bin/difft --color always --background dark --display inline --context 5 --tab-width=8 --sort-paths $LOCAL $REMOTE"
|
||||||
|
|
||||||
[gpg]
|
[gpg]
|
||||||
format = "openpgp"
|
format = "openpgp"
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,10 @@
|
||||||
color = "always";
|
color = "always";
|
||||||
context = 5;
|
context = 5;
|
||||||
display = "inline";
|
display = "inline";
|
||||||
|
extraArgs = [
|
||||||
|
"--tab-width=8"
|
||||||
|
"--sort-paths"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue