2024-03-16 19:49:00 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
2021-03-13 01:01:29 +01:00
|
|
|
let
|
|
|
|
cfg = config.my.home.gpg;
|
|
|
|
in
|
2021-02-21 19:43:33 +01:00
|
|
|
{
|
2021-04-07 19:40:11 +02:00
|
|
|
options.my.home.gpg = with lib; {
|
|
|
|
enable = my.mkDisableOption "gpg configuration";
|
|
|
|
|
2024-03-16 19:49:00 +01:00
|
|
|
pinentry = mkPackageOption pkgs "pinentry" { default = [ "pinentry-tty" ]; };
|
2021-02-21 19:43:33 +01:00
|
|
|
};
|
|
|
|
|
2021-03-13 01:01:29 +01:00
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
programs.gpg = {
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
services.gpg-agent = {
|
|
|
|
enable = true;
|
|
|
|
enableSshSupport = true; # One agent to rule them all
|
2024-03-16 19:49:00 +01:00
|
|
|
pinentryPackage = cfg.pinentry;
|
2021-03-13 01:01:29 +01:00
|
|
|
extraConfig = ''
|
|
|
|
allow-loopback-pinentry
|
|
|
|
'';
|
|
|
|
};
|
2023-03-24 12:18:08 +01:00
|
|
|
|
|
|
|
home.shellAliases = {
|
|
|
|
# Sometime `gpg-agent` errors out...
|
|
|
|
reset-agent = "gpg-connect-agent updatestartuptty /bye";
|
|
|
|
};
|
2021-02-21 19:43:33 +01:00
|
|
|
};
|
|
|
|
}
|