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;
|
enable = true;
|
||||||
inherit userName;
|
inherit userName;
|
||||||
inherit userEmail;
|
inherit userEmail;
|
||||||
|
gpgKey = gpgSigningKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
# password manager
|
# password manager
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue