diff --git a/configuration.nix b/configuration.nix index 36685a9..3698ae8 100644 --- a/configuration.nix +++ b/configuration.nix @@ -20,8 +20,4 @@ nix.settings.experimental-features = [ "nix-command" "flakes" ]; system.stateVersion = "25.11"; - - environment.sessionVariables = { - SSH_AUTH_SOCK = "$HOME/.bitwarden-ssh-agent.sock"; - }; } diff --git a/modules/home.nix b/modules/home.nix index 241b5cd..8ebe992 100644 --- a/modules/home.nix +++ b/modules/home.nix @@ -30,4 +30,8 @@ in imports = homeModules; home.stateVersion = "25.11"; }; + + home.sessionVariables = { + SSH_AUTH_SOCK = "${config.home.homeDirectory}/.bitwarden-ssh-agent.sock"; + }; } diff --git a/modules/home/session.nix b/modules/home/session.nix index 0b7b475..31b246f 100644 --- a/modules/home/session.nix +++ b/modules/home/session.nix @@ -7,7 +7,6 @@ }; systemd.user.sessionVariables = { - SSH_AUTH_SOCK = "${config.home.homeDirectory}/.bitwarden-ssh-agent.sock"; BROWSER = "librewolf"; }; } diff --git a/modules/home/ssh.nix b/modules/home/ssh.nix index d8e336d..e45ce74 100644 --- a/modules/home/ssh.nix +++ b/modules/home/ssh.nix @@ -5,6 +5,9 @@ enable = true; enableDefaultConfig = false; matchBlocks = { + "*" = { + identityAgent = "~/.bitwarden-ssh-agent.sock"; + }; "localhost" = { extraOptions.UserKnownHostsFile = "/dev/null"; };