Skip to content

Fix GnuPG by adding pinentry flavor option#965

Closed
jD91mZM2 wants to merge 1 commit intonix-community:masterfrom
jD91mZM2:fix-gnupg
Closed

Fix GnuPG by adding pinentry flavor option#965
jD91mZM2 wants to merge 1 commit intonix-community:masterfrom
jD91mZM2:fix-gnupg

Conversation

@jD91mZM2
Copy link
Copy Markdown
Member

@jD91mZM2 jD91mZM2 closed this Dec 30, 2019
@jD91mZM2
Copy link
Copy Markdown
Member Author

Turns out this isn't what made it work - it's that I used nixos' agent. I'll reopen once I've investigated further.

@jD91mZM2
Copy link
Copy Markdown
Member Author

Now I removed the system-wide option I had accidentally configured. And made sure this PR still worked.

@jD91mZM2 jD91mZM2 reopened this Dec 30, 2019
@jD91mZM2 jD91mZM2 force-pushed the fix-gnupg branch 2 times, most recently from cb557a1 to 15809e5 Compare December 30, 2019 14:40
@jD91mZM2
Copy link
Copy Markdown
Member Author

@rycee I started working on making it more like what you suggested in #908 (comment).

I think the default should should be a wrapper package that dynamically chooses the right pinentry depending on the currently running desktop environment. It seems to me that it should only be necessary to change the option if one would like to slim down the system by reducing the "generic pinentry" closure.

I'm not at all sure how the actual detection should go - I'd be thankful if someone with more insight in GNOME/KDE/all DE things could continue this PR. I don't even know what gcr is in the first place

@rycee
Copy link
Copy Markdown
Member

rycee commented Dec 31, 2019

I haven't thought very hard about this but my idea would be to have some form of heuristic based on the value of, for example, the XDG_CURRENT_DESKTOP and GDMSESSION environment variables.

The problem is

  1. figuring out which variables to use and how,
  2. figuring out how to get the variables into the systemd environment where gpg-agent can see them,
  3. if 2 and 3 doesn't work easily, figure out a different way to do it.

I think it's not trivial to solve so my suggestion for now would be to skip the wrapper script to have at least some basic solution in place while figuring out how to do things nicely 🙂

@jD91mZM2
Copy link
Copy Markdown
Member Author

Thanks! I updated it to simply fix the wording in the doc comment. The old commit is still available for anyone to branch off of as a tag on my fork.

@rycee
Copy link
Copy Markdown
Member

rycee commented Jan 1, 2020

Thanks! Rebased to master in ebf1df5. Note, I made some slight edits to the description.

@rycee rycee closed this Jan 1, 2020
@Gerschtli
Copy link
Copy Markdown
Contributor

Hey, it seems that this PR is responsible for an error I am receiving on a casual home-manager switch:

while evaluating the attribute 'pinentry.flavors' at undefined position:
attribute 'flavors' missing, at /root/.nix-defexpr/channels/home-manager/modules/services/gpg-agent.nix:134:41

This error message makes perfect sense, because this attribute is missing:

$> nix eval nixpkgs.pinentry.flavors
error: attribute 'flavors' in selection path 'nixpkgs.pinentry.flavors' not found

@rycee
Copy link
Copy Markdown
Member

rycee commented Jan 5, 2020

@Gerschtli You are using the master branch of Home Manager with a stable branch of NixOS/Nixpkgs. You need to switch to the corresponding stable branch of Home Manager, currently release-19.09.

@Gerschtli
Copy link
Copy Markdown
Contributor

Ah, that makes sense, thank you!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants