{ config, lib, pkgs, self, ... }:

let
  cfg = config.samfelag.modules.system.gpg;
in
{
  options.samfelag.modules.system.gpg = {
    enable = lib.mkEnableOption "gpg";
  };
  config = lib.mkIf cfg.enable {
    programs.gnupg.agent = {
      enable = true;
      enableSSHSupport = true;
      pinentryFlavor = "qt";
    };
    environment.systemPackages = with pkgs; [
      pinentry
    ];
  };
}
