commit 6af1d96f98c23ed02209d959e857990a82a80cb0
parent f08c012d3b62ecf9bd45267fcdd09abd1fae7aec
Author: Vincent Demeester <vincent@sbr.pm>
Date: Fri, 15 Nov 2019 09:21:05 +0100
profiles.gpg: add a pinentry configuration 🔦
The main reason is to be able to use the system pinentry binary if not
running on something else than NixOS.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/machines/naruhodo.nix b/machines/naruhodo.nix
@@ -16,6 +16,7 @@ with import ../assets/machines.nix;{
minikube.enable = false;
};
profiles.finances.enable = true;
+ profiles.gpg.pinentry = "/usr/bin/pinentry";
profiles.zsh = {
enable = true;
};
diff --git a/modules/profiles/gpg.nix b/modules/profiles/gpg.nix
@@ -12,6 +12,11 @@ in
description = "Enable gpg profile and configuration";
type = types.bool;
};
+ pinentry = mkOption {
+ default = "${pkgs.pinentry}/bin/pinentry";
+ description = "Path to pinentry";
+ type = types.str;
+ };
};
};
config = mkIf cfg.enable {
@@ -21,6 +26,10 @@ in
enable = true;
enableSshSupport = true;
defaultCacheTtlSsh = 7200;
+ extraConfig = ''
+allow-emacs-pinentry
+pinentry-program ${cfg.pinentry}
+ '';
};
};
};