fix(desktop): drive ssh askpass via pinentry-qt

`pkgs.ksshaskpass` no longer exists top-level (moved under kdePackages) and
would drag in ~1 GB of KDE Frameworks. Reuse the pinentry-qt already pulled
for GPG through a small SSH_ASKPASS wrapper instead: no new GUI toolkit, and
ssh PIN prompts match the commit-signing dialog.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-07 08:45:11 +02:00
parent 0d6b8ca13a
commit 2cba23b804
+14 -5
View File
@@ -9,6 +9,16 @@ let
terminal = "foot"; terminal = "foot";
browser = "librewolf"; browser = "librewolf";
editor = "nvim"; editor = "nvim";
# SSH_ASKPASS helper that drives the GPG pinentry-qt: ssh passphrase/PIN
# prompts reuse the same Qt dialog as commit signing, adding no extra GUI
# toolkit (a packaged askpass would drag in KDE/GTK — hundreds of MB).
sshAskpass = pkgs.writeShellScript "ssh-askpass-pinentry" ''
desc=$(printf '%s' "''${1:-Passphrase:}" | sed 's/%/%25/g')
printf 'SETTITLE ssh\nSETPROMPT PIN:\nSETDESC %s\nGETPIN\nBYE\n' "$desc" \
| ${pkgs.pinentry-qt}/bin/pinentry-qt \
| sed -n 's/^D //p'
'';
in in
{ {
imports = [ ./gpg.nix ./media.nix ]; imports = [ ./gpg.nix ./media.nix ];
@@ -36,10 +46,10 @@ in
# Mute the harmless "Wayland does not support QWindow::requestActivate()" # Mute the harmless "Wayland does not support QWindow::requestActivate()"
# spam Qt apps (keepassxc) print; scoped to that one log category only. # spam Qt apps (keepassxc) print; scoped to that one log category only.
QT_LOGGING_RULES = "qt.qpa.wayland=false"; QT_LOGGING_RULES = "qt.qpa.wayland=false";
# GUI helper for ssh passphrase/PIN prompts. Not forced: with a tty ssh still # GUI helper for ssh passphrase/PIN prompts (see sshAskpass above). Not
# prompts inline; the helper is only used when a caller sets # forced: with a tty ssh still prompts inline; the helper is used only when a
# SSH_ASKPASS_REQUIRE (e.g. a headless/agent context). # caller sets SSH_ASKPASS_REQUIRE (e.g. a headless/agent context).
SSH_ASKPASS = "${pkgs.ksshaskpass}/bin/ksshaskpass"; SSH_ASKPASS = "${sshAskpass}";
}; };
# Sets XDG_{CONFIG,DATA,CACHE}_HOME and enables xdg.configFile management. # Sets XDG_{CONFIG,DATA,CACHE}_HOME and enables xdg.configFile management.
xdg.enable = true; xdg.enable = true;
@@ -53,7 +63,6 @@ in
nodejs nodejs
highlight # `ccat` alias: syntax-highlighted cat highlight # `ccat` alias: syntax-highlighted cat
libreoffice libreoffice
ksshaskpass # Qt GUI prompt for ssh passphrase/PIN (see SSH_ASKPASS above)
]; ];
# ---- Per-tool config files, routed into XDG dirs --------------------- # ---- Per-tool config files, routed into XDG dirs ---------------------