summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorReno Reckling <exi@wthack.de>2016-01-24 11:18:30 +0100
committerReno Reckling <exi@wthack.de>2016-01-24 11:18:30 +0100
commit312bae7fc07c846d70751ff2d414db2b11c43563 (patch)
tree37b3df4a84a2b437ef95fe27fd7368810898d485 /nixos/modules
parente8cc9204a85a871e35014f578536a362fcd1c682 (diff)
downloadnixlib-312bae7fc07c846d70751ff2d414db2b11c43563.tar
nixlib-312bae7fc07c846d70751ff2d414db2b11c43563.tar.gz
nixlib-312bae7fc07c846d70751ff2d414db2b11c43563.tar.bz2
nixlib-312bae7fc07c846d70751ff2d414db2b11c43563.tar.lz
nixlib-312bae7fc07c846d70751ff2d414db2b11c43563.tar.xz
nixlib-312bae7fc07c846d70751ff2d414db2b11c43563.tar.zst
nixlib-312bae7fc07c846d70751ff2d414db2b11c43563.zip
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.
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/programs/ssh.nix5
1 files changed, 1 insertions, 4 deletions
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";