!apXxbtexmNGJaAryzM:nixos.org

NixOS on WSL

338 Members
https://github.com/nix-community/NixOS-WSL57 Servers

Load older messages


SenderMessageTime
22 Oct 2024
@common16:matrix.orgcommon16Here's what my flake currently looks like: http://pastie.org/p/3N2t6Kw1PGAZ6QXtemPcXB17:10:41
@common16:matrix.orgcommon16Every time I start WSL I'm using ssh-add to manually add my GH creds but I'm not sure if it's being added to the wrong(?) ssh-agent or what's going on17:11:16
@common16:matrix.orgcommon16I also removed git completely from the Windows side of my machine so I'm not even sure if the .gitconfig is still valid to "inject" into my WSL(?)17:12:16
@bumperboat:matrix.orgbumperboatwithout seeing an error - my guess since I do not see any configuration to start and configure a user ssh-agent within your user environment that the ssh-add will fail22:08:38
@bumperboat:matrix.orgbumperboati would suggest look at using home-manager for your user it can be configured to start the agent for you and manage all the things (tm)22:10:22
@bumperboat:matrix.orgbumperboatinteresting, i didnt know nixos proper had these systemd.user.services - and has programs.ssh.startAgent - it uses environment.extraInit to set the ssh-agent environment variables - but i dunno how fish works as its not posix if that works -- you will have to see if ssh-agent is running for your user and make sure the environment variables are being set correctly22:43:17
@common16:matrix.orgcommon16I think I'm getting a bit confused as to how ssh-agent works. The actual error I'm receiving is a generic "ssh: connect to host github.com port 22: Connection timed out"23:32:00
@common16:matrix.orgcommon16When I update the ssh-add line to be "ssh-add ~/.ssh/id_ed25519_no_passkey" I can see that it successfully adds the identity but I'm not sure if it's adding it for a stale agent(?)23:32:41
@common16:matrix.orgcommon16

In my fish.shellInit I've also tried doing:

if test -z "$SSH_AUTH_SOCK"
  set -l latest_socket (ls -t /tmp/ssh-*/agent.* | head -n 1)
  set -gx SSH_AUTH_SOCK $latest_socket
end

and eval $(ssh-agent -c)

23:33:43
@common16:matrix.orgcommon16But I mainly have no idea what I'm doing and am just winging it lol23:38:01
23 Oct 2024
@bumperboat:matrix.orgbumperboatThe error is not authentication it's not getting that far 00:20:48
@bumperboat:matrix.orgbumperboatAre you on ipv6 only00:21:47
@bumperboat:matrix.orgbumperboatOr behind a firewall 00:23:38
@common16:matrix.orgcommon16I shouldn't be (aside from general defaults). I was previously able to push / pull (even using WSL) but it seems to be really temperamental now that I've been gutting the Windows side00:47:18
@bumperboat:matrix.orgbumperboat oohh if you run which git -- is it in your windows path or something? 03:32:57
@bumperboat:matrix.orgbumperboator ssh03:35:55
@leiti:e4xo.org@leiti:e4xo.org left the room.08:08:59
@common16:matrix.orgcommon16Those are all my WSL path(s). e.g., /run/current-system/sw/bin/git and bin/ssh-agent14:09:29
@common16:matrix.orgcommon16 * Those are all my WSL path(s). e.g., /run/current-system/sw/bin/git and /run/current-system/sw/bin/ssh-agent14:44:06
@common16:matrix.orgcommon16 bumperboat: How would you set this up if you were to start fresh? I'm only really looking to pull from GH using an SSH key 16:29:19
@nebucatnetzer13:matrix.org@nebucatnetzer13:matrix.org left the room.21:42:35
24 Oct 2024
@bumperboat:matrix.orgbumperboati suggest leaning into home-manager for user config - it can then be used to install your configuration on non nixos systems as well. it has abstractions to set environment variables and aliases that are generic to allow you to use different shells with impunity00:24:30
@common16:matrix.orgcommon16I thought it was more than user config that was at play though(?) 🤔01:50:38
@common16:matrix.orgcommon16Honestly I wonder if this is a fish issue. I can run ssh-agent -c a bunch of times and each time it'll spin up a new agent(?) and I can successfully ssh-add my passkey but it will more often than not still timeout when trying to push and pull from GH 01:53:22
@common16:matrix.orgcommon16I've been able to get it to work only twice so far but both were shortlived and I'm not entirely sure how / why they were working01:53:45
@bumperboat:matrix.orgbumperboatoh i misunderstood your question about starting fresh then. yes it sounds like your agent is not setup right. 02:17:31
@common16:matrix.orgcommon16Do you have any guidance on how I can ensure my agent is configured correctly? Right now I ideally would only have my passkey on the Windows side and then everything else would be WSL / Nix side02:22:14
@bumperboat:matrix.orgbumperboati dont know fish shell02:23:37
@common16:matrix.orgcommon16I switched over to zsh and it looks like that remedied most / all(?) of my SSH woes. Now I'm just battling python woes lol15:33:25
@ixxie:matrix.org@ixxie:matrix.org left the room.15:54:14

Show newer messages


Back to Room ListRoom Version: 9