feat(nix/prog/git): add gpg key

This commit is contained in:
Dmitriy Pleshevskiy 2022-06-01 16:48:29 +03:00
parent 2c76b09827
commit bcf4579811
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
3 changed files with 13 additions and 0 deletions

View file

@ -60,6 +60,7 @@ in
enable = true;
inherit userName;
inherit userEmail;
gpgKey = gpgSigningKey;
};
# password manager

View file

@ -22,6 +22,12 @@ in
type = types.str;
description = "Set your global email";
};
gpgKey = mkOption {
type = types.nullOr types.str;
default = null;
description = "The default GnuPG signing key fingerprint";
};
};
config = mkIf cfg.enable {
@ -29,6 +35,10 @@ in
enable = true;
userName = cfg.userName;
userEmail = cfg.userEmail;
signing = mkIf (cfg.gpgKey != null) {
key = cfg.gpgKey;
signByDefault = true;
};
extraConfig = {
init.defaultBranch = "main";
pull.rebase = true;

View file

@ -7,5 +7,7 @@
git = {
userName = "Bob Ross";
userEmail = "bross@example.com";
# gpg --list-secret-keys
gpgSigningKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
};
}