From 0639aa34f1c2e584598c19a38990e81ad2b86ae2 Mon Sep 17 00:00:00 2001 From: Congee Date: Fri, 8 Jul 2022 13:26:09 -0400 Subject: [PATCH] git: add option to set difftastic display setting --- modules/programs/git.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/modules/programs/git.nix b/modules/programs/git.nix index c79bdae20..7539ab82c 100644 --- a/modules/programs/git.nix +++ b/modules/programs/git.nix @@ -265,6 +265,16 @@ in { Determines when difftastic should color its output. ''; }; + + display = mkOption { + type = + types.enum [ "side-by-side" "side-by-side-show-both" "inline" ]; + default = "side-by-side"; + example = "inline"; + description = '' + Determines how the output displays - in one column or two columns. + ''; + }; }; delta = { @@ -476,8 +486,12 @@ in { home.packages = [ pkgs.difftastic ]; programs.git.iniContent = let - difftCommand = - "${pkgs.difftastic}/bin/difft --color ${cfg.difftastic.color} --background ${cfg.difftastic.background}"; + difftCommand = concatStringsSep " " [ + "${pkgs.difftastic}/bin/difft" + "--color ${cfg.difftastic.color}" + "--background ${cfg.difftastic.background}" + "--display ${cfg.difftastic.display}" + ]; in { diff.external = difftCommand; core.pager = "${pkgs.less}/bin/less -XF";