This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

5pkgs.kagi-search: fix rbw pinentry with pinentry-auto wrapper

pinentry-auto uses pinentry-tty when a TTY is available, falls back to
pinentry-rofi otherwise. Set once in rbw config so the agent stays
unlocked across calls (changing pinentry config restarts the agent,
which was dropping the unlocked state).

+19 -8
+3 -8
5pkgs/kagi-search/package.nix
··· 1 1 { 2 2 pkgs, 3 + pinentry-auto ? pkgs.callPackage ../pinentry-auto/package.nix { }, 3 4 ... 4 5 }: 5 6 let ··· 17 18 ]; 18 19 text = '' 19 20 if ! rbw unlocked 2>/dev/null; then 20 - if [ -t 0 ]; then 21 - rbw unlock 22 - else 23 - saved_pinentry=$(rbw config show | ${pkgs.jq}/bin/jq -r '.pinentry') 24 - rbw config set pinentry ${pkgs.pinentry-rofi}/bin/pinentry-rofi 25 - trap 'rbw config set pinentry "$saved_pinentry"' EXIT 26 - rbw unlock 27 - fi 21 + rbw config set pinentry ${pinentry-auto}/bin/pinentry-auto 22 + rbw unlock 28 23 fi 29 24 ${python}/bin/python ${./kagi_search.py} "$@" 30 25 '';
+9
5pkgs/pinentry-auto/package.nix
··· 1 + { pkgs, ... }: 2 + pkgs.writeShellApplication { 3 + name = "pinentry-auto"; 4 + runtimeInputs = [ 5 + pkgs.pinentry-tty 6 + pkgs.pinentry-rofi 7 + ]; 8 + text = builtins.readFile ./pinentry-auto.sh; 9 + }
+7
5pkgs/pinentry-auto/pinentry-auto.sh
··· 1 + #!/usr/bin/env bash 2 + # pinentry-auto: use pinentry-tty when a TTY is available, fall back to pinentry-rofi 3 + if [ -t 0 ]; then 4 + exec pinentry-tty "$@" 5 + else 6 + exec pinentry-rofi "$@" 7 + fi