nixos/pkgs/pinentry-selector.nix

23 lines
380 B
Nix
Raw Normal View History

{ pkgs }:
pkgs.writeShellApplication {
name = "pinentry";
runtimeInputs = with pkgs; [
pinentry-all
];
text = ''
case $(tty) in
/dev/tty[1-9])
pinentry-curses;;
/dev/pts/*)
if [ -z "$SSH_CLIENT" ]; then
pinentry-qt
else
pinentry-curses
fi
;;
*)
pinentry-curses;;
esac
'';
}