mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-24 18:00:58 +01:00
programs.git: make signing key id be optional (#1886)
* Git: Make signing key id be optional Thus by default the signing key is selected by commit’s author. * Git: Add tests for config with and without signing key id * Git: Format tests for signing key * Git: Remove default value (null) for signing key * Git: Update description for signing key
This commit is contained in:
parent
25a6a6d298
commit
cc60c22c69
6 changed files with 73 additions and 3 deletions
|
|
@ -61,8 +61,13 @@ let
|
|||
signModule = types.submodule {
|
||||
options = {
|
||||
key = mkOption {
|
||||
type = types.str;
|
||||
description = "The default GPG signing key fingerprint.";
|
||||
type = types.nullOr types.str;
|
||||
description = ''
|
||||
The default GPG signing key fingerprint.
|
||||
</para><para>
|
||||
Set to <literal>null</literal> to let GnuPG decide what signing key
|
||||
to use depending on commit’s author.
|
||||
'';
|
||||
};
|
||||
|
||||
signByDefault = mkOption {
|
||||
|
|
@ -303,7 +308,7 @@ in {
|
|||
|
||||
(mkIf (cfg.signing != null) {
|
||||
programs.git.iniContent = {
|
||||
user.signingKey = cfg.signing.key;
|
||||
user.signingKey = mkIf (cfg.signing.key != null) cfg.signing.key;
|
||||
commit.gpgSign = cfg.signing.signByDefault;
|
||||
gpg.program = cfg.signing.gpgPath;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue