The initial post is from 2021 and I have the same Issue in 2026?
Is there somewhere a solution to get it runnig, or do I have to search for an other distrio?
I completly reinstall my whole machine with the newest version, updated all. Do the settings like explaind, used all possible combinations but NOTHING works.
Then I am out of ideas, for me it worked back then. Though I had to reboot after any change, as there is some nasty caching of failure states in GnuPG.
If you read the post you linked, you’ll notice that the OP there also said in 2021:
Please don’t make this into some kind of witch-hunt about bugs not being addressed.
Please do provide details on what you tried (in sufficient detail that a stranger could reproduce it on a VM, ideally) and what happens when you do try. Hoping you do get this solved, as computer problems can be frustrating for sure.
This is incredibly basic, but do you actually have gnupg.enable = true; somewhere in your configuration? The Nix configuration fragment you showed won’t do anything unless you also add that setting, outside the config = lib.mkIf config.gnupg.enable block.
What do ls -l /run/current-system/sw/bin/pinentry and ls -l $(dirname $(readlink /run/current-system/sw/bin/pinentry)) print?
Assuming the commands in step 2 indicate that /run/current-system/sw/bin/pinentry does exist and isn’t a broken symbolic link, what happens if you run it by hand from the shell?
Hmmm…. I had a chance to look at my config and all I’m seeing is the following:
{
lib,
pkgs,
config,
...
}:
{
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
}
Check ps -a | grep gpg for any extra gpg-related services. Shell init tutorials often include snippets for launching the gpg agent, which would interfere with your NixOS settings.
I’d suspect that you’re not inheriting the login shell session correctly, and/or missing the systemd variable import. Share your fullconfiguration.nix, as well as any shell and xinit or wayland compositor config files you use that aren’t tracked by it.
Sharing the output of env in the shell you’re using for gpg would help a ton, too.
It seems this leeds to the right path… the output of ps -a | grep gpg is empty.
My laptop uses cosmic + zsh, there everything is working.
My workstation uses Niri + ion, there are issues with gpg.
Finaly I want to use Niri + ion on all my devices.
For testing I run cosmic desktop on my workstation, but same result, nothing works.
Put back individual pieces of the rest of it only as you discover you need them. In particular, I bet the environment.systemPackages part is redundant to the programs.gpg.agent part; pcscd should only be needed if you are intending to keep your GPG keys on a “smart card” or USB security dongle; and enableSSHSupport makes gpg-agent take over ssh-agent’s job, which is something you probably don’t want.