1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-13 10:13:39 +02:00
home-manager/tests/modules/programs/git/git-with-signing-key-id-legacy.nix
Leah Amelia Chen fde2bc71d3
git: add alternate signing methods
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
2023-11-13 13:26:47 +01:00

29 lines
739 B
Nix

{ lib, options, ... }: {
config = {
programs.git = {
enable = true;
userName = "John Doe";
userEmail = "user@example.org";
signing = {
gpgPath = "path-to-gpg";
key = "00112233445566778899AABBCCDDEEFF";
signByDefault = true;
};
};
test.asserts.warnings.expected = [
"The option `programs.git.signing.gpgPath' defined in ${
lib.showFiles options.programs.git.signing.gpgPath.files
} has been renamed to `programs.git.signing.signer'."
];
nmt.script = ''
assertFileExists home-files/.config/git/config
assertFileContent home-files/.config/git/config ${
./git-with-signing-key-id-legacy-expected.conf
}
'';
};
}