1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-14 11:57:55 +00:00

git: add config option for gpg.format

git provides three options for signing key format, openpgp(default),
ssh, and x509. This commit provides the option to specify one of the
other two available formats.
This commit is contained in:
Ezri Zhu 2024-08-16 17:52:35 -04:00
parent 086f619dd9
commit 1b5fabc20a
3 changed files with 14 additions and 0 deletions

View file

@ -38,6 +38,17 @@ let
defaultText = "\${pkgs.gnupg}/bin/gpg2";
description = "Path to GnuPG binary to use.";
};
gpgFormat = mkOption {
type = types.str;
default = "openpgp";
defaultText = "openpgp";
description = ''
Specifies which key format to use when signing with
--gpg-sign. Default is "openpgp". Other possible values
are "x509", "ssh".
'';
};
};
};
@ -421,6 +432,7 @@ in {
commit.gpgSign = mkDefault cfg.signing.signByDefault;
tag.gpgSign = mkDefault cfg.signing.signByDefault;
gpg.program = cfg.signing.gpgPath;
gpg.format = cfg.signing.gpgFormat;
};
})

View file

@ -38,6 +38,7 @@
smudge = "git-lfs smudge -- %f"
[gpg]
format = "ssh"
program = "path-to-gpg"
[interactive]

View file

@ -55,6 +55,7 @@ in {
}
];
signing = {
gpgFormat = "ssh";
gpgPath = "path-to-gpg";
key = "00112233445566778899AABBCCDDEEFF";
signByDefault = true;