Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions home-manager/packages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,26 @@ with pkgs;
]
++ lib.optionals (stdenv.isLinux && isDesktop) [
_1password-gui
baobab
brightnessctl
celluloid
cheese
chromium
clickup
cliphist
code-cursor
discord
eog
evince
ffmpeg
file-roller
gedit
ghostty
github-desktop
gnome-disk-utility
google-chrome
grim
gthumb
hypridle
hyprlock
hyprpicker
Expand All @@ -146,11 +153,14 @@ with pkgs;
hyprsunset
libnotify
linux-wallpaperengine
loupe

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

This change introduces loupe, and another part of the pull request adds eog (on line 137). Both are image viewers, with loupe being the modern successor to eog in GNOME. To avoid redundancy in installed applications, you might want to consider including only one of them. For a more modern setup, keeping loupe and removing eog would be a reasonable choice.

nautilus
pavucontrol
playerctl
rofi
rofimoji
seahorse
shotwell
signal-desktop
slack
slurp
Expand Down
10 changes: 7 additions & 3 deletions named-hosts/matic/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -434,13 +434,17 @@ inputs.nixpkgs.lib.nixosSystem {
};
};

# GNOME Keyring - auto-unlocks GPG key on login via PAM
services.gnome.gnome-keyring.enable = true;
security.pam.services.greetd.enableGnomeKeyring = true;
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved

# GPG agent configuration
services.gpg-agent = {
enable = true;
enableSshSupport = false;
pinentry.package = pkgs.pinentry-tty;
defaultCacheTtl = 94608000; # 3 years
maxCacheTtl = 94608000; # 3 years
pinentry.package = pkgs.pinentry-gnome3;
defaultCacheTtl = 2147483647; # max (effectively forever)
maxCacheTtl = 2147483647; # max (effectively forever)
Comment on lines +531 to +532
Comment on lines +530 to +532

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

For GnuPG gpg-agent (current stable docs), what are recommended default-cache-ttlandmax-cache-ttl values for desktop usage, and what are the security implications of setting them to 2147483647?

💡 Result:

For desktop usage, the official GnuPG documentation recommends the default values for gpg-agent: default-cache-ttl of 600 seconds (10 minutes) and max-cache-ttl of 7200 seconds (2 hours). These are explicitly stated as the defaults in the gpg-agent man page and agent options documentation across multiple GnuPG versions, including the current stable series (2.5.x as of 2026). No specific "recommended" values different from defaults are given for desktop usage in official docs; the defaults are considered suitable for general interactive use, balancing convenience and security. Setting default-cache-ttl and max-cache-ttl to 2147483647 (2^31-1 seconds, approximately 68 years) effectively disables passphrase expiration. Security implications include: - Passphrases remain in memory indefinitely (until agent restart or manual eviction), increasing risk if the machine is compromised, stolen, or accessed by an unauthorized local user. - Heightens exposure to memory-dumping attacks (e.g., via tools like gpg_reaper demonstrated in a GnuPG bug report). - Conflicts with security best practices for desktop environments, where session-based caching (e.g., until logout) is preferable. - Even with long TTLs, newer GnuPG versions use timers for eviction (not just on access), but extremely long values still pose risks. To apply: Edit ~/.gnupg/gpg-agent.conf with the options (without leading --), then gpgconf --kill gpg-agent; gpgconf --launch gpg-agent.

Citations:


Avoid effectively-forever GPG cache TTLs.

Lines 473–474 set passphrase cache retention to ~68 years (2147483647 seconds). Official GnuPG documentation recommends default-cache-ttl of 600 seconds (10 minutes) and max-cache-ttl of 7200 seconds (2 hours). Extended TTLs significantly weaken workstation security if the user session is compromised, as passphrases remain in memory indefinitely and increase exposure to memory-dumping attacks. Keep the GNOME unlock flow but bound gpg-agent TTLs to practical limits.

Suggested change
           services.gpg-agent = {
             enable = true;
             enableSshSupport = false;
             pinentry.package = pkgs.pinentry-gnome3;
-            defaultCacheTtl = 2147483647; # max (effectively forever)
-            maxCacheTtl = 2147483647; # max (effectively forever)
+            defaultCacheTtl = 28800; # 8h
+            maxCacheTtl = 86400; # 24h cap
           };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pinentry.package = pkgs.pinentry-gnome3;
defaultCacheTtl = 2147483647; # max (effectively forever)
maxCacheTtl = 2147483647; # max (effectively forever)
pinentry.package = pkgs.pinentry-gnome3;
defaultCacheTtl = 28800; # 8h
maxCacheTtl = 86400; # 24h cap
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@named-hosts/matic/default.nix` around lines 472 - 474, The GPG agent TTLs are
set to effectively forever via the attributes defaultCacheTtl and maxCacheTtl
(with pinentry.package set to pkgs.pinentry-gnome3); change these to bounded,
practical values (e.g., defaultCacheTtl = 600 and maxCacheTtl = 7200) to follow
GnuPG recommendations while preserving the GNOME pinentry flow; update the named
attributes defaultCacheTtl and maxCacheTtl accordingly so passphrases are not
retained indefinitely.

};

# GPG_TTY is set in fish shell init instead of sessionVariables
Expand Down
Loading