Skip to content

feat(matic): persist GPG passphrase across reboots - #844

Closed
shunkakinoki wants to merge 1 commit into
mainfrom
feat/gpg-passphrase-persistence
Closed

feat(matic): persist GPG passphrase across reboots#844
shunkakinoki wants to merge 1 commit into
mainfrom
feat/gpg-passphrase-persistence

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Feb 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Switch pinentry-tty to pinentry-gnome3 for GNOME Keyring (libsecret) integration
  • Enable services.gnome-keyring with secrets component for persistent storage
  • GPG signing passphrase now survives reboots instead of being lost from in-memory cache

Test plan

  • sudo nixos-rebuild switch
  • Sign a commit — GUI pinentry dialog should appear
  • Check "Save in password manager" checkbox
  • Reboot and sign another commit — passphrase should be retrieved automatically

Summary by cubic

Persist the GPG signing passphrase across reboots on matic by switching to pinentry-gnome3 and enabling GNOME Keyring (secrets). Signing prompts can be saved to the keyring and are loaded automatically after reboot.

Written for commit ee36988. Summary will update on new commits.

Switch pinentry from tty to gnome3 and enable GNOME Keyring secrets
component so the GPG signing passphrase survives reboots.
Copilot AI review requested due to automatic review settings February 17, 2026 00:02
@coderabbitai

coderabbitai Bot commented Feb 17, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@shunkakinoki has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 25 minutes and 12 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/gpg-passphrase-persistence

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @shunkakinoki, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the user experience for GPG signing by implementing persistent storage for passphrases. By integrating GNOME Keyring, users will no longer need to re-enter their GPG passphrase after a reboot, streamlining the signing workflow and improving convenience.

Highlights

  • Pinentry Package Update: Switched the GPG agent's pinentry package from pinentry-tty to pinentry-gnome3 to integrate with GNOME Keyring.
  • GNOME Keyring Integration: Enabled services.gnome-keyring with the secrets component to provide persistent storage for GPG passphrases.
  • Persistent GPG Passphrase: GPG signing passphrases will now be stored persistently and survive system reboots, eliminating the need for re-entry.
Changelog
  • named-hosts/matic/default.nix
    • Updated the services.gpg-agent.pinentry.package from pkgs.pinentry-tty to pkgs.pinentry-gnome3.
    • Added a new configuration block for services.gnome-keyring, enabling it and specifying secrets as a component for persistent storage.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mesa-dot-dev

mesa-dot-dev Bot commented Feb 17, 2026

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@mesa-dot-dev

mesa-dot-dev Bot commented Feb 17, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Switch pinentry-tty to pinentry-gnome3 for GNOME Keyring (libsecret) integration and enable services.gnome-keyring with secrets component for persistent storage. GPG signing passphrase now survives reboots instead of being lost from in-memory cache.

What changed?

  • Switched pinentry-tty to pinentry-gnome3 for GNOME Keyring (libsecret) integration
  • Enabled services.gnome-keyring with secrets component for persistent storage

Description generated by Mesa. Update settings

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request correctly configures gpg-agent with pinentry-gnome3 and enables services.gnome-keyring to persist the GPG passphrase across reboots. The changes are logical and well-contained. I have one suggestion to ensure the GNOME Keyring is automatically unlocked upon login, which will provide a more seamless experience and align with the goal of automatic passphrase retrieval.

Comment on lines +405 to +408
services.gnome-keyring = {
enable = true;
components = [ "secrets" ];
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Enabling gnome-keyring is a great step for persisting the GPG passphrase. However, for the keyring to be unlocked automatically on login (and thus for the GPG passphrase to be retrieved without any prompt), you'll also need to configure PAM for greetd.

This requires adding the following to your NixOS system configuration in this file:

security.pam.services.greetd.gnome-keyring.enable = true;

Without this, you will likely be prompted for your keyring password the first time a secret is accessed in a new session. This might not match the expectation of the passphrase being retrieved 'automatically' as mentioned in the test plan.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the NixOS/Home Manager configuration for the matic host to support GUI pinentry and attempt persistent GPG passphrase storage via GNOME Keyring/libsecret.

Changes:

  • Switch GPG agent pinentry from pinentry-tty to pinentry-gnome3.
  • Enable Home Manager services.gnome-keyring with the secrets component.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 398 to 401
enableSshSupport = false;
pinentry.package = pkgs.pinentry-tty;
pinentry.package = pkgs.pinentry-gnome3;
defaultCacheTtl = 94608000; # 3 years
maxCacheTtl = 94608000; # 3 years

Copilot AI Feb 17, 2026

Copy link

Choose a reason for hiding this comment

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

Switching to pkgs.pinentry-gnome3 makes GPG signing depend on a graphical session (DISPLAY/WAYLAND + D-Bus). In pure TTY contexts (e.g., VT, SSH session without GUI forwarding), pinentry-gnome3 will fail to prompt and GPG operations can break. Consider using a pinentry wrapper/fallback (GUI when available, curses/tty otherwise) or keeping pinentry-tty for this host if TTY signing is expected.

Copilot uses AI. Check for mistakes.
Comment on lines +404 to +408
# GNOME Keyring for persistent GPG passphrase storage across reboots
services.gnome-keyring = {
enable = true;
components = [ "secrets" ];
};

Copilot AI Feb 17, 2026

Copy link

Choose a reason for hiding this comment

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

Enabling Home Manager services.gnome-keyring alone typically won’t auto-unlock the login keyring after reboot; without PAM integration (e.g., security.pam.services.<login-service>.enableGnomeKeyring = true for greetd/login), the first post-reboot signing attempt usually triggers a keyring unlock prompt, so the passphrase won’t be retrieved “automatically” as described. If the goal is truly seamless post-reboot retrieval, add the appropriate NixOS PAM/keyring integration for this host’s greetd login flow.

Copilot uses AI. Check for mistakes.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 1 file

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="named-hosts/matic/default.nix">

<violation number="1" location="named-hosts/matic/default.nix:405">
P2: GNOME Keyring is enabled without enabling the PAM integration for `greetd`, so the keyring stays locked after login and the passphrase won’t auto-unlock across reboots. Configure `security.pam.services.greetd.enableGnomeKeyring = true` alongside this block.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

};

# GNOME Keyring for persistent GPG passphrase storage across reboots
services.gnome-keyring = {

@cubic-dev-ai cubic-dev-ai Bot Feb 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: GNOME Keyring is enabled without enabling the PAM integration for greetd, so the keyring stays locked after login and the passphrase won’t auto-unlock across reboots. Configure security.pam.services.greetd.enableGnomeKeyring = true alongside this block.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At named-hosts/matic/default.nix, line 405:

<comment>GNOME Keyring is enabled without enabling the PAM integration for `greetd`, so the keyring stays locked after login and the passphrase won’t auto-unlock across reboots. Configure `security.pam.services.greetd.enableGnomeKeyring = true` alongside this block.</comment>

<file context>
@@ -396,11 +396,17 @@ inputs.nixpkgs.lib.nixosSystem {
           };
 
+          # GNOME Keyring for persistent GPG passphrase storage across reboots
+          services.gnome-keyring = {
+            enable = true;
+            components = [ "secrets" ];
</file context>
Fix with Cubic

shunkakinoki pushed a commit that referenced this pull request Feb 20, 2026
The original PR #844 was missing the critical PAM integration needed to
auto-unlock GNOME Keyring on login via greetd. Without it, the keyring
stays locked after reboot and GPG passphrases can't be auto-retrieved.

Changes:
- Add security.pam.services.greetd.enableGnomeKeyring for auto-unlock
- Switch pinentry from tty to gnome3 for keyring integration
- Enable GNOME Keyring secrets service for persistent storage

https://claude.ai/code/session_01MoWYgtw2oTthtJLLZFHqTo
shunkakinoki added a commit that referenced this pull request Feb 20, 2026
#874)

* fix: add PAM integration for GPG passphrase persistence across reboots

The original PR #844 was missing the critical PAM integration needed to
auto-unlock GNOME Keyring on login via greetd. Without it, the keyring
stays locked after reboot and GPG passphrases can't be auto-retrieved.

Changes:
- Add security.pam.services.greetd.enableGnomeKeyring for auto-unlock
- Switch pinentry from tty to gnome3 for keyring integration
- Enable GNOME Keyring secrets service for persistent storage

https://claude.ai/code/session_01MoWYgtw2oTthtJLLZFHqTo

* chore: update

* chore: update

* chore: update

* fix: enable Docker daemon and group for docker-postgres service

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
@shunkakinoki
shunkakinoki deleted the feat/gpg-passphrase-persistence branch February 26, 2026 04:25
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.

2 participants