git: support alternate signing methods (#5516)

The Git module now supports SSH and X.509 signing in addition to
OpenPGP/GnuPG, via setting the `programs.git.signing.format` option.
It defaults to `openpgp` for now as a backwards compatibility measure,
but I feel like we shouldn't enforce GPG as the default on everyone,
especially for people who use SSH signing like me.

Accordingly, `programs.git.signing.gpgPath` has been renamed to
`programs.git.signing.signer`, as now the signer binary is not
restricted to GnuPG. Users should only get a warning and everything
should continue to work.

Fixes #4221, supersedes #4235

Co-authored-by: Mario Rodas <marsam@users.noreply.github.com>
Co-authored-by: Sumner Evans <me@sumnerevans.com>
Co-authored-by: Leah Amelia Chen <hi@pluie.me>
This commit is contained in:
Sizhe Zhao 2025-02-15 02:47:27 +08:00 committed by GitHub
parent 5031c6d297
commit 7da01bc47a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 201 additions and 45 deletions

View file

@ -3,6 +3,7 @@
git-with-most-options = ./git.nix;
git-with-msmtp = ./git-with-msmtp.nix;
git-with-str-extra-config = ./git-with-str-extra-config.nix;
git-with-signing-key-id-legacy = ./git-with-signing-key-id-legacy.nix;
git-with-signing-key-id = ./git-with-signing-key-id.nix;
git-without-signing-key-id = ./git-without-signing-key-id.nix;
git-with-hooks = ./git-with-hooks.nix;