blob: 386c1a55691b6aec5a9c7f7ce343e7eff1224e7e (
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
|
{ options, config, lib, pkgs, namespace, ... }:
with lib; with lib.${namespace}; let
cfg = config.${namespace}.tools.gpg;
impermanence = config.${namespace}.impermanence;
in {
options.${namespace}.tools.gpg = with types; {
enable = mkEnableOption "gpg";
};
config = mkIf cfg.enable {
home.persistence.${impermanence.secure.location} = {
directories = [
".gnupg"
];
};
#NOTE: required for pinentry-gnome3
home.packages = with pkgs; [
gcr
];
programs.gpg.enable = true;
services.gpg-agent = {
enable = true;
pinentry.package = (pkgs.writeShellScriptBin "pinentry-wrapper" ''
if [[ -v DISPLAY ]]; then
exec ${pkgs.pinentry-gnome3}/bin/pinentry-gnome3 "$@"
fi
exec ${pkgs.pinentry-gnome3}/bin/pinentry-tty "$@"
'');
};
};
}
|