Guide: How to use 1Password SSH WSL integration with programs other than Git #589
songpola
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, everyone!
I would like to share how I make 1Password SSH work with programs other than Git in NixOS-WSL.
According to the 1Password docs:
You can configure Git to use
ssh.exe
, but not all programs can be configured like this.For example, when using Docker Context.
My solution is to substitute the system
openssh
package for a custom one that symlinkedssh
andssh-add
bins to the OpenSSHssh.exe
andssh-add.exe
on Windows, respectively. (Path:/mnt/c/Windows/System32/OpenSSH/
)So, I create a new derivation (package), using
symlinkJoin
(to avoid recompiling theopenssh
package), and then set theprograms.ssh.package
NixOS option to it.You can check my
nixos-config
for example.ssh-wsl-win
derivation packagesnowfall-lib
, so the package is automatically included inpkgs
(just like an overlay).$out/bin/*
bins to$out/bin/*-wsl
for backup (ssh -> ssh-wsl
,ssh-add -> ssh-add-wsl
)programs.ssh.package
songpola
by thesnowfall-lib
.This way, you can use
ssh
andssh-add
as usual, and other programs will use it too. (You don't even need to alias them in the shells!) And if you somehow want to use the original commands, then you can just usessh-wsl
andssh-add-wsl
.Beta Was this translation helpful? Give feedback.
All reactions