blob: 58d57cac6c747ab2ff1191b6053ce67b3bba82ce [file] [log] [blame]
{ 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;
extraConfig = ''
pinentry-program ${pinentry-multiplexed}/bin/pinentry-multiplexed
'';
pinentryFlavor = null;
};
home.packages = [
pinentry-multiplexed
];
}