From 312bae7fc07c846d70751ff2d414db2b11c43563 Mon Sep 17 00:00:00 2001 From: Reno Reckling Date: Sun, 24 Jan 2016 11:18:30 +0100 Subject: nixos-ssh: set SSH_ASKPASS globally and not just on interactive shells If we limit SSH_ASKPASS to interactive shells, users are unable to trigger the ssh-passphrase dialog from their desktop environment autostart scripts. Usecase: I call ssh-add during my desktop environment autostart and want to have the passphrase dialog immediately after startup. For this to work, SSH_ASKPASS needs to be propagated properly on non-interactive shells. --- nixos/modules/programs/ssh.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'nixos/modules') diff --git a/nixos/modules/programs/ssh.nix b/nixos/modules/programs/ssh.nix index 260888be485f..2da8ff738fbc 100644 --- a/nixos/modules/programs/ssh.nix +++ b/nixos/modules/programs/ssh.nix @@ -221,10 +221,7 @@ in fi ''; - environment.interactiveShellInit = optionalString config.services.xserver.enable - '' - export SSH_ASKPASS=${askPassword} - ''; + environment.variables.SSH_ASKPASS = optionalString config.services.xserver.enable askPassword; programs.ssh.askPassword = mkDefault "${pkgs.x11_ssh_askpass}/libexec/x11-ssh-askpass"; -- cgit 1.4.1