mirror of
https://github.com/nix-community/home-manager
synced 2024-06-01 04:23:34 +02:00
Merge d34d74f5ea
into 6d3b6dc922
This commit is contained in:
commit
71409d995c
|
@ -221,6 +221,12 @@ in {
|
||||||
See <https://github.com/Wilfred/difftastic>.
|
See <https://github.com/Wilfred/difftastic>.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
enableAsDifftool = mkEnableOption "" // {
|
||||||
|
description = ''
|
||||||
|
Enable the {command}`difftastic` syntax highlighter as a git difftool.
|
||||||
|
See <https://github.com/Wilfred/difftastic>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
background = mkOption {
|
background = mkOption {
|
||||||
type = types.enum [ "light" "dark" ];
|
type = types.enum [ "light" "dark" ];
|
||||||
|
@ -477,18 +483,26 @@ in {
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.difftastic.enable {
|
(let
|
||||||
home.packages = [ pkgs.difftastic ];
|
difftCommand = concatStringsSep " " [
|
||||||
|
"${pkgs.difftastic}/bin/difft"
|
||||||
programs.git.iniContent = let
|
"--color ${cfg.difftastic.color}"
|
||||||
difftCommand = concatStringsSep " " [
|
"--background ${cfg.difftastic.background}"
|
||||||
"${pkgs.difftastic}/bin/difft"
|
"--display ${cfg.difftastic.display}"
|
||||||
"--color ${cfg.difftastic.color}"
|
];
|
||||||
"--background ${cfg.difftastic.background}"
|
in (lib.mkMerge [
|
||||||
"--display ${cfg.difftastic.display}"
|
(mkIf cfg.difftastic.enable {
|
||||||
];
|
home.packages = [ pkgs.difftastic ];
|
||||||
in { diff.external = difftCommand; };
|
programs.git.iniContent = { diff.external = difftCommand; };
|
||||||
})
|
})
|
||||||
|
(mkIf cfg.difftastic.enableAsDifftool {
|
||||||
|
home.packages = [ pkgs.difftastic ];
|
||||||
|
programs.git.iniContent = {
|
||||||
|
diff = { tool = lib.mkDefault "difftastic"; };
|
||||||
|
difftool = { difftastic = { cmd = "difft $LOCAL $REMOTE"; }; };
|
||||||
|
};
|
||||||
|
})
|
||||||
|
]))
|
||||||
|
|
||||||
(let
|
(let
|
||||||
deltaPackage = cfg.delta.package;
|
deltaPackage = cfg.delta.package;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user