Update gpg to use an env variable for pinentry
diff --git a/src/apps/personal/gpg.nix b/src/apps/personal/gpg.nix
index a064ed0..58d57ca 100644
--- a/src/apps/personal/gpg.nix
+++ b/src/apps/personal/gpg.nix
@@ -1,11 +1,27 @@
-{ pkgs, ... }: {
+{ pkgs, ... }: let
+ pinentry-multiplexed = pkgs.writeScriptBin "pinentry-multiplexed" ''
+ case $PINENTRY_USER_DATA in
+ tty)
+ exec ${pkgs.pinentry.tty}/bin/pinentry "$@"
+ ;;
+ none)
+ exit 1
+ ;;
+ *)
+ exec ${pkgs.pinentry.qt}/bin/pinentry "$@"
+ esac
+ '';
+in {
programs.gpg.enable = true;
services.gpg-agent = {
enable = true;
- pinentryFlavor = "qt";
+ extraConfig = ''
+ pinentry-program ${pinentry-multiplexed}/bin/pinentry-multiplexed
+ '';
+ pinentryFlavor = null;
};
- home.packages = with pkgs; [
- pinentry_qt
+ home.packages = [
+ pinentry-multiplexed
];
-}
\ No newline at end of file
+}