git: add delta.package option
This makes it possible to conveniently customize the `delta` package. PR #3897
This commit is contained in:
parent
5904f12d7d
commit
e21ec3db17
|
@ -310,6 +310,8 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
package = mkPackageOption pkgs "delta" { };
|
||||||
|
|
||||||
options = mkOption {
|
options = mkOption {
|
||||||
type = with types;
|
type = with types;
|
||||||
let
|
let
|
||||||
|
@ -538,11 +540,13 @@ in {
|
||||||
in { diff.external = difftCommand; };
|
in { diff.external = difftCommand; };
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf cfg.delta.enable {
|
(let
|
||||||
home.packages = [ pkgs.delta ];
|
deltaPackage = cfg.delta.package;
|
||||||
|
deltaCommand = "${deltaPackage}/bin/delta";
|
||||||
|
in mkIf cfg.delta.enable {
|
||||||
|
home.packages = [ deltaPackage ];
|
||||||
|
|
||||||
programs.git.iniContent = let deltaCommand = "${pkgs.delta}/bin/delta";
|
programs.git.iniContent = {
|
||||||
in {
|
|
||||||
core.pager = deltaCommand;
|
core.pager = deltaCommand;
|
||||||
interactive.diffFilter = "${deltaCommand} --color-only";
|
interactive.diffFilter = "${deltaCommand} --color-only";
|
||||||
delta = cfg.delta.options;
|
delta = cfg.delta.options;
|
||||||
|
|
Loading…
Reference in a new issue