Added gpg config

This commit is contained in:
Alejandro Angulo 2023-03-19 08:56:42 -07:00
parent e62903e640
commit f0d75d5632
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6
2 changed files with 42 additions and 1 deletions

View file

@ -7,6 +7,7 @@
}: }:
with lib; let with lib; let
cfg = config.aa.tools.git; cfg = config.aa.tools.git;
gpg = config.aa.tools.gpg;
user = config.aa.user; user = config.aa.user;
in { in {
options.aa.tools.git = with types; { options.aa.tools.git = with types; {
@ -52,7 +53,7 @@ in {
signing = { signing = {
key = cfg.signingKey; key = cfg.signingKey;
signByDefault = false; # TODO: Only set if gpg is enabled signByDefault = mkIf gpg.enable true;
}; };
ignores = [ ignores = [

View file

@ -0,0 +1,40 @@
{
options,
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.aa.tools.git;
user = config.aa.user;
in {
options.aa.tools.gpg = with types; {
enable = mkEnableOption "gpg";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [gnupg pinentry-curses];
aa.home.extraOptions = {
programs.gpg = {
enable = true;
scdaemonSettings = {
# Fix conflicts with config in common/yubikey.nix
disable-ccid = true;
};
};
services.gpg-agent = {
enable = true;
pinentryFlavor = "curses";
enableZshIntegration = true; # TODO: Only set if using zsh
enableSshSupport = true;
sshKeys = [
# run `gpg-connect-agent 'keyinfo --list' /bye` to get these values for existing keys
"E274D5078327CB6C8C83CFF102CC12A2D493C77F"
];
};
};
};
}