feat(nix/prog/git): add gpg key
This commit is contained in:
parent
2c76b09827
commit
bcf4579811
3 changed files with 13 additions and 0 deletions
|
@ -60,6 +60,7 @@ in
|
|||
enable = true;
|
||||
inherit userName;
|
||||
inherit userEmail;
|
||||
gpgKey = gpgSigningKey;
|
||||
};
|
||||
|
||||
# password manager
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -7,5 +7,7 @@
|
|||
git = {
|
||||
userName = "Bob Ross";
|
||||
userEmail = "bross@example.com";
|
||||
# gpg --list-secret-keys
|
||||
gpgSigningKey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue