git: Add textconv hook for age diff
This commit is contained in:
parent
78c9a2cab9
commit
d6d2857322
|
@ -1,4 +1,4 @@
|
|||
{ config, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
programs.git = {
|
||||
enable = true;
|
||||
|
@ -12,6 +12,18 @@
|
|||
extraConfig = {
|
||||
core.quotepath = "off";
|
||||
pull.ff = "only";
|
||||
diff = {
|
||||
age = {
|
||||
# This uses the de facto default key location with no ability to
|
||||
# specify another key.
|
||||
# If decryption fails (e.g. due to a lack of the right private key,
|
||||
# rage’s error message will be displayed instead of the file’s
|
||||
# contents.
|
||||
textconv = toString (pkgs.writeShellScript "git-age-textconv" ''
|
||||
${pkgs.rage}/bin/rage -d -i ${config.xdg.configHome}/age/keys.txt "$@" 2>&1 || true
|
||||
'');
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
ignores = [
|
||||
|
|
Loading…
Reference in a new issue