aboutsummaryrefslogtreecommitdiff
path: root/modules/home-manager/gpg.nix
blob: fda423142ad6693b73dd7b7ccb56420e23d85550 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
  config,
  pkgs,
  lib,
  system,
  ...
}:

let
  pinentryPackage = if pkgs.stdenv.isDarwin then pkgs.pinentry_mac else pkgs.pinentry-curses;
in
{
  options.gpg.enable = lib.mkEnableOption "Setup gpg and agent";
  config = lib.mkIf config.gpg.enable {
    programs.gpg.enable = true;
    services.gpg-agent = {
      enable = true;
      pinentry.package = pinentryPackage;
    };
  };
}