2023-03-19 15:56:42 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
2023-04-16 17:07:42 +00:00
|
|
|
cfg = config.aa.tools.gpg;
|
2023-03-19 15:56:42 +00:00
|
|
|
in {
|
|
|
|
options.aa.tools.gpg = with types; {
|
|
|
|
enable = mkEnableOption "gpg";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2024-04-04 03:14:39 +00:00
|
|
|
environment.systemPackages = [pkgs.gnupg ];
|
2023-03-19 15:56:42 +00:00
|
|
|
|
|
|
|
aa.home.extraOptions = {
|
|
|
|
programs.gpg = {
|
|
|
|
enable = true;
|
|
|
|
scdaemonSettings = {
|
|
|
|
# Fix conflicts with config in common/yubikey.nix
|
|
|
|
disable-ccid = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-11-26 17:55:40 +00:00
|
|
|
programs.ssh.matchBlocks = {
|
|
|
|
# Fix for pinentry showing up in wrong terminal
|
|
|
|
"*".match = "host * exec \"gpg-connect-agent UPDATESTARTUPTTY /bye\"";
|
|
|
|
};
|
|
|
|
|
2023-03-19 15:56:42 +00:00
|
|
|
services.gpg-agent = {
|
|
|
|
enable = true;
|
2024-04-04 03:14:39 +00:00
|
|
|
pinentryPackage = pkgs.pinentry-curses;
|
2023-04-02 23:24:39 +00:00
|
|
|
enableZshIntegration = true; # TODO: Only set if using zsh
|
2023-03-19 15:56:42 +00:00
|
|
|
enableSshSupport = true;
|
|
|
|
sshKeys = [
|
|
|
|
# run `gpg-connect-agent 'keyinfo --list' /bye` to get these values for existing keys
|
|
|
|
"E274D5078327CB6C8C83CFF102CC12A2D493C77F"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|