1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-24 18:59:47 +01:00

git: add option to set difftastic display setting

This commit is contained in:
Congee 2022-07-08 13:26:09 -04:00 committed by Robert Helgesson
parent c645cc9f82
commit 0639aa34f1
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -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";