about summary refs log tree commit diff stats
path: root/home-manager/config/gpg/default.nix
blob: f4a7cc150902f4a3e8af724bb03e029dfe7b95ba (plain) (blame)
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
42
43
44
45
{
  config,
  sysLib,
  pkgs,
  ...
}: let
  agent-program = sysLib.writeShellScriptWithLibrary {
    name = "onlykey-gpg-agent";
    src = ./agent-program;
    dependencies = with pkgs; [
      python3
      onlykey-agent
    ];
  };
in {
  programs.gpg = {
    enable = true;
    homedir = "${config.xdg.dataHome}/gnupg/onlykey";
    mutableKeys = false;
    mutableTrust = false;
    settings = {
      # Hardware-based GPG configuration
      agent-program = "${agent-program}/bin/onlykey-gpg-agent";

      default-key = "Soispha <soispha@vhack.eu>";
      # TODO add more
    };
    publicKeys = [
      {
        source = ./keys/sils_at_sils.li;
        trust = "full";
      }
      {
        source = ./keys/soispha_at_vhack.eu;
        trust = "ultimate";
      }
    ];
  };
  services.gpg-agent = {
    enable = false;
    enableZshIntegration = true;
    enableScDaemon = true; # smartcards and such things
    pinentryFlavor = "tty";
  };
}