-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Fixes for gnupg agent module #26888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes for gnupg agent module #26888
Conversation
These just seem to duplicate upstream systemd units, which are already included in nixos configuration by systemd.packages
Does Also there's a bit of a balance between reifying configuration as nix code, or leaving config as upstream. In some places of nixos, we've been moving configuration to use the nix language, this makes it somewhat more flexible when working in a nix configuration since overrides are possible. In other cases, porting the configuration takes too long and we have just left them as raw text that gets substituted into the relevant locations. I'm not sure whether it's better to have the systemd config for gnupg reified as nix config, or left as just systemd unit files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not convinced, since @danielfullmer is not convinced of himself. I would like to delegate to CMCDragonkai the final decision.
I'll mention that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the preferred solution is to just override the upstream units. Putting gnupg in systemd.packages
works just fine for user units. We're just not reloading the systemd user instances on a system switch.
Thanks a lot! 🍻 |
Otherwise some programmes cannot use the GPG agent, e.g. applications started from dmenu. Behaviour was changed in #26888, this reverts that part.
Reverted the |
Motivation for this change
1b6176e caused a few problems for me with the gnupg agent module in nixos.
With
programs.gnupg.agent.enable
andprograms.gnupg.agent.enableSSHSupport
both set totrue
, logging in freezes for me while runninggpg-connect-agent
.Additionally, I get the following messages in the journal:
It appears that duplicating the systemd units in both
systemd.packages
as well assystemd.user.{sockets,services}
causes gpg-agent to try to bind to multiple sockets. Perhaps this causes gpg-connect-agent to freeze? In any case, I don't see why we can't just use the upstream systemd units, which fixes the problem for me anyway.In case it's useful, I'll mention that I also wrote some nixos tests to ensure the gpg agent config is working properly, since this seems to break for me frequently. These tests ensure pinentry displays properly when invoked through gpg-agent, both for console and x11 usage:
https://github.com/danielfullmer/nixos-config/blob/master/tests/gpg-agent.nix
https://github.com/danielfullmer/nixos-config/blob/master/tests/gpg-agent-x11.nix
While writing these tests, I also noticed that the nixos test driver fails with:
I can't think of any reason why noninteractive shells would need to call
gpg-connect-agent
, so I restricted that tointeractiveShellInit
, but I might be overlooking something by doing so.Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)CC @CMCDragonkai @fpletz