From f30ab0611c62a1129168b64c015eb9a77b8b3282 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Wed, 12 Jun 2024 22:48:40 -0400 Subject: [PATCH] apps.keepassxc: migrate to lib.generators.toINI --- homeManagerModules/apps/keepassxc/default.nix | 70 ++++++++++--------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/homeManagerModules/apps/keepassxc/default.nix b/homeManagerModules/apps/keepassxc/default.nix index f484efe2..cf2d5e08 100644 --- a/homeManagerModules/apps/keepassxc/default.nix +++ b/homeManagerModules/apps/keepassxc/default.nix @@ -5,42 +5,48 @@ ... }: { config = lib.mkIf config.alyraffauf.apps.keepassxc.enable { - home.packages = [pkgs.keepassxc]; - xdg.configFile."keepassxc/keepassxc.ini".text = '' - [General] - ConfigVersion=2 - HideWindowOnCopy=true - MinimizeAfterUnlock=false - MinimizeOnOpenUrl=true + home = { + file.".cache/keepassxc/keepassxc.ini".text = lib.generators.toINI {} { + General.LastActiveDatabase = "/${config.home.homeDirectory}/sync/Passwords.kdbx"; + }; + packages = [pkgs.keepassxc]; + }; - [Browser] - AlwaysAllowAccess=true - CustomProxyLocation= - Enabled=true - SearchInAllDatabases=true + xdg.configFile."keepassxc/keepassxc.ini".text = lib.generators.toINI {} { + Browser = { + AlwaysAllowAccess = true; + Enabled = true; + SearchInAllDatabases = true; + }; - [GUI] - ApplicationTheme=classic - ColorPasswords=false - CompactMode=true - MinimizeOnClose=true - MinimizeOnStartup=false - MinimizeToTray=true - ShowTrayIcon=true - TrayIconAppearance=colorful + General = { + ConfigVersion = 2; + HideWindowOnCopy = true; + MinimizeAfterUnlock = false; + MinimizeOnOpenUrl = true; + }; - [PasswordGenerator] - AdditionalChars= - ExcludedChars= + GUI = { + ApplicationTheme = "classic"; + ColorPasswords = false; + CompactMode = true; + MinimizeOnClose = true; + MinimizeOnStartup = false; + MinimizeToTray = true; + ShowTrayIcon = true; + TrayIconAppearance = "colorful"; + }; - [SSHAgent] - Enabled=true + Security = { + ClearClipboardTimeout = 15; + EnableCopyOnDoubleClick = true; + IconDownloadFallback = true; + LockDatabaseScreenLock = true; + }; - [Security] - ClearClipboardTimeout=15 - EnableCopyOnDoubleClick=true - IconDownloadFallback=true - LockDatabaseScreenLock=true - ''; + SSHAgent = { + Enabled = true; + }; + }; }; }