parent
03b4f81679
commit
cba7b6ee6e
|
@ -1503,6 +1503,16 @@ in
|
|||
A new module is available: 'programs.aria2'
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2020-05-04T21:19:43+00:00";
|
||||
condition = config.programs.git.enable;
|
||||
message = ''
|
||||
The Git module now supports the 'delta' syntax highlighter.
|
||||
|
||||
It can be enabled through the option 'programs.git.delta.enable'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -215,6 +215,24 @@ in {
|
|||
'';
|
||||
};
|
||||
};
|
||||
|
||||
delta = {
|
||||
enable = mkEnableOption "" // {
|
||||
description = ''
|
||||
Whether to enable the <command>delta</command> syntax highlighter.
|
||||
See <link xlink:href="https://github.com/dandavison/delta" />.
|
||||
'';
|
||||
};
|
||||
|
||||
options = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [ ];
|
||||
example = [ "--dark" ];
|
||||
description = ''
|
||||
Extra command line options given to delta.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -309,5 +327,16 @@ in {
|
|||
([ "git-lfs" "smudge" ] ++ skipArg ++ [ "--" "%f" ]);
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.delta.enable {
|
||||
programs.git.iniContent = let
|
||||
deltaArgs = [ "${pkgs.gitAndTools.delta}/bin/delta" ]
|
||||
++ cfg.delta.options;
|
||||
in {
|
||||
core.pager = concatStringsSep " " deltaArgs;
|
||||
interactive.diffFilter =
|
||||
concatStringsSep " " (deltaArgs ++ [ "--color-only" ]);
|
||||
};
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
[commit]
|
||||
gpgSign = true
|
||||
|
||||
[core]
|
||||
pager = "@deltaCommand@ --dark"
|
||||
|
||||
[extra]
|
||||
boolean = true
|
||||
integer = 38
|
||||
|
@ -28,6 +31,9 @@
|
|||
[gpg]
|
||||
program = "path-to-gpg"
|
||||
|
||||
[interactive]
|
||||
diffFilter = "@deltaCommand@ --dark --color-only"
|
||||
|
||||
[user]
|
||||
email = "user@example.org"
|
||||
name = "John Doe"
|
||||
|
|
|
@ -15,6 +15,8 @@ let
|
|||
pkgs.substituteAll {
|
||||
src = path;
|
||||
|
||||
deltaCommand = "${pkgs.gitAndTools.delta}/bin/delta";
|
||||
|
||||
git_include_path = pkgs.writeText "contents"
|
||||
(builtins.readFile ./git-expected-include.conf);
|
||||
};
|
||||
|
@ -56,6 +58,10 @@ in {
|
|||
userEmail = "user@example.org";
|
||||
userName = "John Doe";
|
||||
lfs.enable = true;
|
||||
delta = {
|
||||
enable = true;
|
||||
options = [ "--dark" ];
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue