summaryrefslogtreecommitdiff
path: root/users/seth/programs/gpg.nix
blob: bd4428e1fecbf14072e1c75381a7163485c9f357 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
  config,
  lib,
  pkgs,
  osConfig,
  ...
}:
let
  cfg = config.seth.programs.gpg;
in
{
  options.seth.programs.gpg = {
    enable = lib.mkEnableOption "GnuPG configuration" // {
      default = config.seth.enable;
      defaultText = lib.literalExpression "config.seth.enable";
    };
  };

  config = lib.mkIf cfg.enable {
    programs.gpg.enable = true;

    services.gpg-agent = lib.mkIf pkgs.stdenv.isLinux {
      enable = true;
      pinentryPackage = osConfig.programs.gnupg.agent.pinentryPackage or pkgs.pinentry-curses;
    };
  };
}