Commit 6af1d96f98c2

Vincent Demeester <vincent@sbr.pm>
2019-11-15 09:21:05
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>
1 parent f08c012
Changed files (2)
machines
modules
profiles
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;
   };
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}
+        '';
       };
     };
   };