nix-config/home/gpg.nix

32 lines
621 B
Nix
Raw Normal View History

2021-03-13 01:01:29 +01:00
{ config, lib, ... }:
let
cfg = config.my.home.gpg;
in
{
2021-04-07 19:40:11 +02:00
options.my.home.gpg = with lib; {
enable = my.mkDisableOption "gpg configuration";
pinentry = mkOption {
type = types.str;
default = "tty";
example = "gtk2";
description = "Which pinentry interface to use";
};
};
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
2021-04-07 19:40:11 +02:00
pinentryFlavor = cfg.pinentry;
2021-03-13 01:01:29 +01:00
extraConfig = ''
allow-loopback-pinentry
'';
};
};
}