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; enable = true;
inherit userName; inherit userName;
inherit userEmail; inherit userEmail;
gpgKey = gpgSigningKey;
}; };
# password manager # password manager

View file

@ -22,6 +22,12 @@ in
type = types.str; type = types.str;
description = "Set your global email"; 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 { config = mkIf cfg.enable {
@ -29,6 +35,10 @@ in
enable = true; enable = true;
userName = cfg.userName; userName = cfg.userName;
userEmail = cfg.userEmail; userEmail = cfg.userEmail;
signing = mkIf (cfg.gpgKey != null) {
key = cfg.gpgKey;
signByDefault = true;
};
extraConfig = { extraConfig = {
init.defaultBranch = "main"; init.defaultBranch = "main";
pull.rebase = true; pull.rebase = true;

View file

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