23 lines
380 B
Nix
23 lines
380 B
Nix
|
|
{ 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
|
||
|
|
'';
|
||
|
|
}
|