Skip to content

feat: add wsl2-ssh-agent integration - #898

Merged
nzbr merged 1 commit into
nix-community:mainfrom
kimburgess:wsl2-ssh-agent
Feb 7, 2026
Merged

feat: add wsl2-ssh-agent integration#898
nzbr merged 1 commit into
nix-community:mainfrom
kimburgess:wsl2-ssh-agent

Conversation

@kimburgess

Copy link
Copy Markdown
Contributor

Adds support for ssh-agent passthrough to the Windows host via wsl2-ssh-agent.

This was recently added to nixpkgs via NixOS/nixpkgs#444409. The package is only available in unstable and the 25.11 beta so as heads up this will not build against 25.05 or earlier. Implementation mirrors the systemd user service in the upstream. It seems to make more sense to include that here than the package itself as this is the only place it will be used.

This enables usage of on-disk keys without mapping these in, TPM backed keys via Windows Hello, or any other source already configured on the outer host.

@nzbr

nzbr commented Dec 15, 2025

Copy link
Copy Markdown
Member

Oh, neat! Thanks

Would it be a problem to add an option to make the SSH agent available to root shells as well?

@kimburgess

Copy link
Copy Markdown
Contributor Author

@nzbr that should be there now. I've added a users option that passes through to ConditionUser= on the unit.

It defaults to !@system (all non-system users) but will also accept a list of user names to enable for if there's a need to be more explicit.

@chetgurevitch

Copy link
Copy Markdown

Can confirm this works, copied the service and SSH_AUTH_SOCK declaration into my config and I'm able to use a windows hello authenticated key for ssh.

@nzbr

nzbr commented Feb 7, 2026

Copy link
Copy Markdown
Member

Nice work, thank you!

@nzbr
nzbr merged commit a767968 into nix-community:main Feb 7, 2026
24 checks passed
@github-actions

github-actions Bot commented Mar 1, 2026

Copy link
Copy Markdown
Contributor

Successfully created backport PR for release-25.11:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants