diff --git a/modules/programs/git.nix b/modules/programs/git.nix index 9b0d4c0d5..a833e2c37 100644 --- a/modules/programs/git.nix +++ b/modules/programs/git.nix @@ -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; }; }) diff --git a/tests/modules/programs/git/git-expected.conf b/tests/modules/programs/git/git-expected.conf index ce1b22edf..61e0a2cc5 100644 --- a/tests/modules/programs/git/git-expected.conf +++ b/tests/modules/programs/git/git-expected.conf @@ -43,6 +43,9 @@ [interactive] diffFilter = "@delta@/bin/delta --color-only" +[tag] + gpgSign = true + [user] email = "user@example.org" name = "John Doe" diff --git a/tests/modules/programs/git/git-with-signing-key-id-expected.conf b/tests/modules/programs/git/git-with-signing-key-id-expected.conf index 4a4289902..b26377aac 100644 --- a/tests/modules/programs/git/git-with-signing-key-id-expected.conf +++ b/tests/modules/programs/git/git-with-signing-key-id-expected.conf @@ -4,6 +4,9 @@ [gpg] program = "path-to-gpg" +[tag] + gpgSign = true + [user] email = "user@example.org" name = "John Doe" diff --git a/tests/modules/programs/git/git-without-signing-key-id-expected.conf b/tests/modules/programs/git/git-without-signing-key-id-expected.conf index 7564b3502..8c04aeda1 100644 --- a/tests/modules/programs/git/git-without-signing-key-id-expected.conf +++ b/tests/modules/programs/git/git-without-signing-key-id-expected.conf @@ -4,6 +4,9 @@ [gpg] program = "path-to-gpg" +[tag] + gpgSign = true + [user] email = "user@example.org" name = "John Doe"