nixos/gnupg: add pinentry to systemPackages#90214
nixos/gnupg: add pinentry to systemPackages#90214jonringer wants to merge 1 commit intoNixOS:masterfrom
Conversation
|
I've encountered a related issue once where I wanted to be able to have 3 different types of environment.extraSetup = ''
ln -s ${pkgs.pinentry-gtk2}/bin/pinentry $out/bin/pinentry-gtk-2
ln -s ${pkgs.pinentry-curses}/bin/pinentry $out/bin/pinentry-curses
ln -s ${pkgs.pinentry}/bin/pinentry $out/bin/pinentry-tty
ln -s $out/bin/pinentry-tty $out/bin/pinentry
''; |
nixos/modules/programs/gnupg.nix
Outdated
There was a problem hiding this comment.
Shouldn't we install the proper pinentry package (i.e. qt, gtk or curses flavour)?
There was a problem hiding this comment.
Not really sure how to implement that logic
There was a problem hiding this comment.
How about solving it just like it's done here:
nixpkgs/nixos/modules/programs/gnupg.nix
Lines 97 to 102 in 7e9b156
There was a problem hiding this comment.
that's constructing a path, I don't think I can put just a path as an item to: environment.systemPackages
There was a problem hiding this comment.
I'm talking about adding pinentry.${cfg.agent.pinentryFlavor} to systemPackages. The pinentry-package as an output for each flavor.
There was a problem hiding this comment.
ah, interesting. I misread that line, though it was "${pkgs.pinentry}.${cfg.agent.pinentryFlavor}", as that's more common
|
Would just adding a pinentry to There were suggestions to add a script to Edit: See #73332 (comment) |
|
I haven't yet tried out, but I could imagine the following might work in more environments and usecases:
That way, it should again become possible to configure the pinentry program via It might also fix some nix-on-non-NixOS usecases, once changes have trickled into the home-manager module. I'll try things out and will send a PR. |
|
So, I did do some digging, and it seems gnupg defaults to On the topic of falling back to ncurses if you're connecting via ssh (as #73332 (comment) seems to suggest): I see there's some ncurses fallback code on some graphical pinentries. However, this seems to not be working in all cases (for example I assume adding more generic support for these things into the graphical pinentries should be a good thing, and could improve the situation a lot. There's also |
|
I made the PR because someone on discord had trouble with the service, and thought it would be an easy enough fix to just include the command on the system PATH. I'm going to transfer this to an issue, and close the PR. I don't have enough familiarity to know a good path forward, if someone else would like to solve the usability issue, then they can do so in a different PR. |
Motivation for this change
This is needed at runtime:
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)