nix-config/modules/home/gpg/default.nix
Bruno BELANYI 4a01a50532
All checks were successful
ci/woodpecker/push/check Pipeline was successful
flake: bump inputs
And fix the update `pinentry` options in home-manager.
2024-03-16 19:49:00 +01:00

32 lines
691 B
Nix

{ config, lib, pkgs, ... }:
let
cfg = config.my.home.gpg;
in
{
options.my.home.gpg = with lib; {
enable = my.mkDisableOption "gpg configuration";
pinentry = mkPackageOption pkgs "pinentry" { default = [ "pinentry-tty" ]; };
};
config = lib.mkIf cfg.enable {
programs.gpg = {
enable = true;
};
services.gpg-agent = {
enable = true;
enableSshSupport = true; # One agent to rule them all
pinentryPackage = cfg.pinentry;
extraConfig = ''
allow-loopback-pinentry
'';
};
home.shellAliases = {
# Sometime `gpg-agent` errors out...
reset-agent = "gpg-connect-agent updatestartuptty /bye";
};
};
}