Skip to content
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

nixos/gnupg: drop references to gtk2; pinentry-*: build dependent variant with an override instead of choosing the output #277221

Closed

Conversation

SuperSandro2000
Copy link
Member

@SuperSandro2000 SuperSandro2000 commented Dec 28, 2023

Description of changes

This PR basically cleans up all #270266

see #270266 (comment)
Closes #276143
Closes #133156

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@con-f-use
Copy link
Contributor

Just wanted to mention again, that all the other pinentry flavors don't handle both tty and graphical prompts as well as gtk2. It's either or with them, so I don't think it should be dropped as a pinentry flavor.

@SuperSandro2000
Copy link
Member Author

all the other pinentry flavors don't handle both tty and graphical prompts as well as gtk2.

I am not sure how gtk2 is realted to tty/curses.

It's either or with them, so I don't think it should be dropped as a pinentry flavor.

It is only dropped as a default entry. You can still configure it to use it.

@SuperSandro2000 SuperSandro2000 changed the title nixos/gnupg: drop references to gtk2 nixos/gnupg: drop references to gtk2; pinentry-*: build dependent variant with an override instead of choosing the output Dec 29, 2023
@ElvishJerricco
Copy link
Contributor

@SuperSandro2000

I am not sure how gtk2 is realted to tty/curses.

The gtk2 pinentry flavor is the only one that will correctly prompt in the terminal if necessary, or graphically if available. e.g. If I SSH into my machine, I can still use gpg with the gtk2 pinentry flavor, because it will put the prompt in the terminal. Meanwhile, it will still give a graphical prompt if I'm using it from the desktop environment. Other graphical pinentry flavors will always put up the graphical prompt on the desktop, even if you're logged in remotely with SSH.

ambroisie added a commit to ambroisie/nix-config that referenced this pull request Jan 3, 2024
The GTK2 variant has been removed [1].

I may revise this in the future if [2] is merged (I'd like to try
`pinentry-rofi` [3]).

[1]: NixOS/nixpkgs#270266
[2]: NixOS/nixpkgs#277221
[3]: https://github.com/plattfot/pinentry-rofi
pinentry-emacs = pinentry.override { enabledFlavors = [ "emacs" ]; };
pinentry-gtk2 = pinentry.override { enabledFlavors = [ "gtk2" ]; };
pinentry-qt = pinentry.override { enabledFlavors = [ "qt" ]; };
pinentry-gnome3 = pinentry.override { enabledFlavors = [ "gnome3" ]; };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vaguely recall that curses was supposed to be a fallback, if gui could not be started. But now the only reference I found is #71095 (comment), which is not very informative.

…ing the output

We don't want to depend on the *enabled* flavors of pinentry but on all
*possible* ones.
This avoids evaluating all the desktop environments at this place.
@SuperSandro2000
Copy link
Member Author

I cannot test all the changes myself - I think they they are correct but I would appreciate it, if other people could help to verify that.

Copy link
Member

@fpletz fpletz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM. Since I'm also using pinentry both graphically and with curses I'm gonna test and merge later today if nobody beats me to it.

Copy link
Member

@fpletz fpletz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not merge for now since only setting one enabledFlavor probably does not provide a proper fallback.

@fpletz fpletz mentioned this pull request Jan 15, 2024
11 tasks
@SuperSandro2000
Copy link
Member Author

Do not merge for now since only setting one enabledFlavor probably does not provide a proper fallback.

I vaguely recall that curses was supposed to be a fallback, if gui could not be started. But now the only reference I found is #71095 (comment), which is not very informative.

Based on this I am not sure that is even working.

@fpletz
Copy link
Member

fpletz commented Jan 15, 2024

Based on this I am not sure that is even working.

I'm using this functionality daily and others have also noted they are using this in other PRs regarding the breakage of pinentry-gtk2.

Copy link
Contributor

@rnhmjoj rnhmjoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I like that DEs set the flavour they need, instead of having gnupg handling it for each and every one.

@fpletz
Copy link
Member

fpletz commented Jan 15, 2024

Some of the useful changes here have been carried over to #133542. Since this PR effectively breaks pinentry's fallback feature, we'll continue in the other PR.

@fpletz fpletz closed this Jan 15, 2024
@SuperSandro2000 SuperSandro2000 deleted the pinentry-gtk2-followup branch January 15, 2024 16:43
@SuperSandro2000
Copy link
Member Author

I'm using this functionality daily and others have also noted they are using this in other PRs regarding the breakage of pinentry-gtk2.

yeah, gtk2 but we don't really know that for the other flavors and I kinda remember that jan some time said, that this might not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pinentry: excessive derivation closure size
10 participants