From e21ec3db17c4b474f6bd9d8b967a3415fbc6b51d Mon Sep 17 00:00:00 2001 From: Sebastian Estrella <2049686+sestrella@users.noreply.github.com> Date: Wed, 19 Apr 2023 23:41:38 -0500 Subject: [PATCH] git: add delta.package option This makes it possible to conveniently customize the `delta` package. PR #3897 --- modules/programs/git.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/programs/git.nix b/modules/programs/git.nix index 75f062f56..415f046d4 100644 --- a/modules/programs/git.nix +++ b/modules/programs/git.nix @@ -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;