diff --git a/modules/programs/git.nix b/modules/programs/git.nix index 9b0d4c0d..a833e2c3 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 ce1b22ed..61e0a2cc 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 4a428990..b26377aa 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 7564b350..8c04aeda 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"