Using Hyprland (on Wayland with greetd + ReGreet as display manager) and wezterm or KeePassXC as example applications, the SSH_AUTH_SOCK variable is not accessible to the applications. I have it in inteactive zsh though, as echo $SSH_AUTH_SOCK
returns the usual /run/user/1000/ssh-agent
.
With SSDM as a display manager, the SSH_AUTH_SOCK
variable is accessible in zsh and KeePassXC, for example.
I start ssh-agent not manually, but with home-managers services.ssh-agent.enable = true;
. In both cases, it is running and fine, as ssh-add
works. My configurations (only excerpts, if more needed will provide):
# home/hyperland.nix
wayland.windowManager.hyprland.enable = true;
wayland.windowManager.hyprland.settings = {
# ... other configuration ...
env = ["XCURSOR_SIZE,24" "HYPRCURSOR_SIZE,24"];
exec-once = [
# "systemctl --user import-environment SSH_AUTH_SOCK"
"[workspace 1 silent] wezterm"
"[workspace 10 silent] ${lib.getExe' pkgs.keepassxc "keepassxc"}"
];
};
# system/graphical.nix
services.greetd.enable = true;
services.greetd.settings = {
default_session = {
command = "${pkgs.dbus}/bin/dbus-run-session ${lib.getExe config.programs.hyprland.package} --config /etc/greetd/hyprland.conf";
user = "greeter";
};
terminal = {vt = 1;};
};
environment.etc."greetd/hyprland.conf".text = ''
# exec-once = systemctl --user import-environment SSH_AUTH_SOCK
exec-once = ${lib.getExe config.programs.regreet.package}; ${lib.getExe' config.programs.hyprland.package "hyprctl"} dispatch exit
'';
programs.regreet.enable = true;
programs.regreet.settings = {
background = {
path = ../../.config/pictures/wallhaven-pastel-mountain.png;
};
};
programs.hyprland.enable = true;