in my configuration.nix. After reboot, gpg-agent is running. And, if I switch to a tty, SSH_AUTH_SOCK is set to the correct value.
However, I’m using the gnome desktop environment. After booting and logging into my user through gnome, SSH_AUTH_SOCK is not set to the correct value. Its set to the standard ssh value.
I’m not 100% sure why that is. Is this because the gnome-shell does not see the variable exported in shellInit? Or is this because gnome overwrites with value? In any case, does anybody have some tips for setting an environment variable in a gnome-shell through the configuration file?
In the intervening 8 years yubico has also moved on, you should be using yubioath-flutter instead of what that guide suggests. I’d be hesitant to follow a guide that old anyway at this point, there are a handful things that strike me as weird, though it’s possible things worked differently at the time.
I don’t know for certain what gpg defaults are these days, but you should probably also almost certainly be using an elliptic curve key rather than an RSA one, which I suspect gpg still configures by default. E.g. codeberg refuses such keys.
I’d wager this is a login/interactive shell thing. Does bash -l help?
okay, thanks for tips. They’re a bit tangential to my question though. I’m not following the guide to set up gpg keys and stuff. Right now I’m mostly focused on trying to set the SSH_AUTH_SOCK variable. I’m still not sure I see how to do that? The SSH_AUTH_SOCK is not be correctly set. Yes I have disables ssh startAgent.
I think gnome key-ring is overwirtting SSH_AUTH_SOCK. So I’ll try to disable that.
Well, then enablestartAgent and don’t try to manually configure it. programs.ssh.startAgent configures this correctly, alongside the systemd service for the gpg agent.
Ah, whoops, sorry, that was my mind completely misinterpreting that option. For some reason I interpreted ssh as gpg, which makes no sense.
I’d instead recommend setting programs.gnupg.agent.enableSSHSupport and related options (including programs.gnupg.agent.enable). This should also install gnupg for you so you don’t have to add that separately. Manually launching the gpg-agent in an initExtra block when you can use systemd to do it (and upstream has a module to do all of that for you) is just way too brittle.