git: gpg sign tags with signing.signByDefault set

The `tag.gpgSign` config option was added in Git 2.23.0 and seems like
it should be set in addition to `commit.gpgSign` when
`programs.git.signing.signByDefault` is enabled
This commit is contained in:
Lily Foster 2022-08-29 11:35:15 -04:00 committed by Robert Helgesson
parent de079ec371
commit 140aaed3df
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
4 changed files with 11 additions and 1 deletions

View file

@ -73,7 +73,7 @@ let
signByDefault = mkOption {
type = types.bool;
default = false;
description = "Whether commits should be signed by default.";
description = "Whether commits and tags should be signed by default.";
};
gpgPath = mkOption {
@ -444,6 +444,7 @@ in {
programs.git.iniContent = {
user.signingKey = mkIf (cfg.signing.key != null) cfg.signing.key;
commit.gpgSign = cfg.signing.signByDefault;
tag.gpgSign = cfg.signing.signByDefault;
gpg.program = cfg.signing.gpgPath;
};
})

View file

@ -43,6 +43,9 @@
[interactive]
diffFilter = "@delta@/bin/delta --color-only"
[tag]
gpgSign = true
[user]
email = "user@example.org"
name = "John Doe"

View file

@ -4,6 +4,9 @@
[gpg]
program = "path-to-gpg"
[tag]
gpgSign = true
[user]
email = "user@example.org"
name = "John Doe"

View file

@ -4,6 +4,9 @@
[gpg]
program = "path-to-gpg"
[tag]
gpgSign = true
[user]
email = "user@example.org"
name = "John Doe"