From 5ba420030a420634cc000ef4de43b6a50e9c0e16 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sat, 13 Jul 2024 21:34:41 -0400 Subject: [PATCH] home/keepassxc: refactored settings --- homeManagerModules/apps/keepassxc/default.nix | 75 ++++++++++--------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/homeManagerModules/apps/keepassxc/default.nix b/homeManagerModules/apps/keepassxc/default.nix index 2e9a4efa..ecb41627 100644 --- a/homeManagerModules/apps/keepassxc/default.nix +++ b/homeManagerModules/apps/keepassxc/default.nix @@ -7,44 +7,45 @@ config = lib.mkIf config.ar.home.apps.keepassxc.enable { home.packages = [pkgs.keepassxc]; - ar.home.apps.keepassxc.settings = lib.mkDefault { - Browser = { - AlwaysAllowAccess = true; - Enabled = true; - SearchInAllDatabases = true; - UpdateBinaryPath = false; + xdg.configFile."keepassxc/keepassxc.ini".text = let + defaults = { + Browser = { + AlwaysAllowAccess = true; + Enabled = true; + SearchInAllDatabases = true; + UpdateBinaryPath = false; + }; + + General = { + ConfigVersion = 2; + HideWindowOnCopy = true; + MinimizeAfterUnlock = false; + MinimizeOnOpenUrl = true; + }; + + GUI = { + ApplicationTheme = "classic"; + ColorPasswords = false; + CompactMode = true; + MinimizeOnClose = true; + MinimizeOnStartup = true; + MinimizeToTray = true; + ShowTrayIcon = true; + TrayIconAppearance = "colorful"; + }; + + Security = { + ClearClipboardTimeout = 15; + EnableCopyOnDoubleClick = true; + IconDownloadFallback = true; + LockDatabaseScreenLock = false; + }; + + SSHAgent.Enabled = true; }; - General = { - ConfigVersion = 2; - HideWindowOnCopy = true; - MinimizeAfterUnlock = false; - MinimizeOnOpenUrl = true; - }; - - GUI = { - ApplicationTheme = "classic"; - ColorPasswords = false; - CompactMode = true; - MinimizeOnClose = true; - MinimizeOnStartup = true; - MinimizeToTray = true; - ShowTrayIcon = true; - TrayIconAppearance = "colorful"; - }; - - Security = { - ClearClipboardTimeout = 15; - EnableCopyOnDoubleClick = true; - IconDownloadFallback = true; - LockDatabaseScreenLock = false; - }; - - SSHAgent.Enabled = true; - }; - - xdg.configFile."keepassxc/keepassxc.ini".text = - lib.generators.toINI {} - config.ar.home.apps.keepassxc.settings; + settings = defaults // config.ar.home.apps.keepassxc.settings; + in + lib.generators.toINI {} settings; }; }