This repository has no description
0

Configure Feed

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

tools.pi: set bundled pinentry before rbw unlock

Reference pinentry-rofi (or pinentry_mac on darwin) directly in the
wrapper and write it to rbw config before unlocking, instead of relying
on a persisted store path that gets garbage-collected and breaks
'rbw unlock' with 'error spawning pinentry: No such file'.

+21 -12
+21 -12
tools/pi/flake-module.nix
··· 96 96 }; 97 97 in 98 98 { 99 - packages.pi = pkgs.writeShellApplication { 100 - name = "pi"; 101 - runtimeInputs = [ pkgs.rbw ]; 102 - text = '' 103 - if [ -z "''${OPENROUTER_API_KEY:-}" ]; then 104 - rbw unlock 105 - OPENROUTER_API_KEY=$(rbw get -f api_key openrouter.ai) 106 - export OPENROUTER_API_KEY 107 - fi 108 - exec ${pi.wrapper}/bin/pi "$@" 109 - ''; 110 - }; 99 + packages.pi = 100 + let 101 + pinentry = 102 + if pkgs.stdenv.isDarwin then 103 + "${pkgs.pinentry_mac}/${pkgs.pinentry_mac.binaryPath}" 104 + else 105 + "${self.packages.${pkgs.system}.pinentry-rofi}/bin/pinentry-rofi"; 106 + in 107 + pkgs.writeShellApplication { 108 + name = "pi"; 109 + runtimeInputs = [ pkgs.rbw ]; 110 + text = '' 111 + if [ -z "''${OPENROUTER_API_KEY:-}" ]; then 112 + rbw config set pinentry ${pinentry} 113 + rbw unlock 114 + OPENROUTER_API_KEY=$(rbw get -f api_key openrouter.ai) 115 + export OPENROUTER_API_KEY 116 + fi 117 + exec ${pi.wrapper}/bin/pi "$@" 118 + ''; 119 + }; 111 120 }; 112 121 }