Skip to content

Instantly share code, notes, and snippets.

@msteen
Created March 11, 2020 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msteen/6d1737a589e2ee5b492632182abdf658 to your computer and use it in GitHub Desktop.
Save msteen/6d1737a589e2ee5b492632182abdf658 to your computer and use it in GitHub Desktop.
{
# The script uses either the CLI or GUI program depending on being in a shell or not.
environment.interactiveShellInit = "export PINENTRY_USER_DATA=$TTY";
nixpkgs.overlays = [
(self: super: {
pinentry-dynamic = super.writeBash "pinentry-dynamic" ''
# http://unix.stackexchange.com/questions/236746/change-pinentry-program-temporarily-with-gpg-agent
# https://github.com/keybase/keybase-issues/issues/1099#issuecomment-59313502
if [[ -z $PINENTRY_USER_DATA ]]; then
exec ${super.pinentry}/bin/pinentry-gtk-2 "$@"
else
exec ${super.pinentry}/bin/pinentry-curses --ttyname "$PINENTRY_USER_DATA" "$@"
fi
'';
})
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment