aboutsummaryrefslogtreecommitdiff
path: root/modules/gpg/default.nix
blob: 37e8b04dd7089f2672e7de84b0291b5882e88e1a (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ config, lib, pkgs, ... }:
let
  cfg = config.modules.gpg;

  inherit (lib) mkEnableOption mkOption mkIf types;
in
{
  options.modules.gpg = {
    enable = mkEnableOption "gpg";
  };

  config = mkIf cfg.enable {
    services.gpg-agent = {
      enable = true;
      # TODO: look into forwarding and extra socket, seems useful
      enableBashIntegration = true;
      enableZshIntegration = true;
      # enableNushellIntegration = true;
      enableSshSupport = true;
      noAllowExternalCache = true;
      pinentryPackage = pkgs.pinentry-qt;
#      sshKeys = [ "36663E191B00E51513F90FA5CF2BCE8461C297CD" ];
    };

    home.file.".gnupg/pinentry-dmenu.conf" = {
      text = ''
        asterisk= "";
        prompt = "";
        font = "ComicShannsMono Nerd Font Mono:size=13";
        prompt_fg = "#cacaca";
        prompt_bg = "#0d0d0d";
        normal_fg = "#4c4c4c";
        normal_bg = "#0d0d0d";
        select_fg = "#8aac8b";
        select_bg = "#0d0d0d";
        desc_fg = "#cacaca";
        desc_bg = "#0d0d0d";
        '';
    };
  };
}