1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-14 11:57:55 +00:00

git: add delta.package option

This makes it possible to conveniently customize the `delta` package.

PR #3897
This commit is contained in:
Sebastian Estrella 2023-04-19 23:41:38 -05:00 committed by Robert Helgesson
parent 5904f12d7d
commit e21ec3db17
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -310,6 +310,8 @@ in {
'';
};
package = mkPackageOption pkgs "delta" { };
options = mkOption {
type = with types;
let
@ -538,11 +540,13 @@ in {
in { diff.external = difftCommand; };
})
(mkIf cfg.delta.enable {
home.packages = [ pkgs.delta ];
(let
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";
in {
programs.git.iniContent = {
core.pager = deltaCommand;
interactive.diffFilter = "${deltaCommand} --color-only";
delta = cfg.delta.options;