From ea8388f1d1425fd8c4f02a5303f1f65ac5fe44b2 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Mon, 17 Jun 2024 16:31:54 -0400 Subject: [PATCH] keepassxc: added settings option and moved current settings to home/aly --- homeManagerModules/apps/keepassxc/default.nix | 46 ++---------------- homeManagerModules/options.nix | 9 +++- homes/aly.nix | 47 +++++++++++++++++-- 3 files changed, 56 insertions(+), 46 deletions(-) diff --git a/homeManagerModules/apps/keepassxc/default.nix b/homeManagerModules/apps/keepassxc/default.nix index fc650067..ce74194f 100644 --- a/homeManagerModules/apps/keepassxc/default.nix +++ b/homeManagerModules/apps/keepassxc/default.nix @@ -5,48 +5,10 @@ ... }: { config = lib.mkIf config.alyraffauf.apps.keepassxc.enable { - home = { - file.".cache/keepassxc/keepassxc.ini".text = lib.generators.toINI {} { - General.LastActiveDatabase = "/${config.home.homeDirectory}/sync/Passwords.kdbx"; - }; - packages = [pkgs.keepassxc]; - }; + home.packages = [pkgs.keepassxc]; - xdg.configFile."keepassxc/keepassxc.ini".text = lib.generators.toINI {} { - Browser = { - AlwaysAllowAccess = true; - Enabled = true; - SearchInAllDatabases = true; - }; - - General = { - ConfigVersion = 2; - HideWindowOnCopy = true; - MinimizeAfterUnlock = false; - MinimizeOnOpenUrl = true; - }; - - GUI = { - ApplicationTheme = "classic"; - ColorPasswords = false; - CompactMode = true; - MinimizeOnClose = true; - MinimizeOnStartup = false; - 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.alyraffauf.apps.keepassxc.settings; }; } diff --git a/homeManagerModules/options.nix b/homeManagerModules/options.nix index 524b3c91..7eefaebc 100644 --- a/homeManagerModules/options.nix +++ b/homeManagerModules/options.nix @@ -23,7 +23,14 @@ firefox.enable = lib.mkEnableOption "Firefox web browser."; fuzzel.enable = lib.mkEnableOption "Fuzzel app launcher."; fzf.enable = lib.mkEnableOption "Fzf fuzzy file finder."; - keepassxc.enable = lib.mkEnableOption "KeePassXC password manager."; + keepassxc = { + enable = lib.mkEnableOption "KeePassXC password manager."; + settings = lib.mkOption { + description = "KeePassXC settings."; + default = {}; + type = lib.types.attrs; + }; + }; librewolf.enable = lib.mkEnableOption "Librewolf web browser."; mako.enable = lib.mkEnableOption "Mako notification daemon."; neofetch.enable = lib.mkEnableOption "Neofetch."; diff --git a/homes/aly.nix b/homes/aly.nix index 832aaf9a..eb68c2b4 100644 --- a/homes/aly.nix +++ b/homes/aly.nix @@ -7,9 +7,10 @@ ... }: { home = { - username = "aly"; homeDirectory = "/home/aly"; - stateVersion = "24.05"; + file.".cache/keepassxc/keepassxc.ini".text = lib.generators.toINI {} { + General.LastActiveDatabase = "${config.home.homeDirectory}/sync/Passwords.kdbx"; + }; packages = with pkgs; [ browsh curl @@ -27,6 +28,8 @@ webcord wget ]; + stateVersion = "24.05"; + username = "aly"; }; programs = { @@ -100,7 +103,45 @@ fastfetch.enable = true; firefox.enable = true; fzf.enable = true; - keepassxc.enable = true; + keepassxc = { + enable = true; + settings = { + Browser = { + AlwaysAllowAccess = true; + Enabled = true; + SearchInAllDatabases = true; + }; + + General = { + ConfigVersion = 2; + HideWindowOnCopy = true; + MinimizeAfterUnlock = false; + MinimizeOnOpenUrl = true; + }; + + GUI = { + ApplicationTheme = "classic"; + ColorPasswords = false; + CompactMode = true; + MinimizeOnClose = true; + MinimizeOnStartup = false; + MinimizeToTray = true; + ShowTrayIcon = true; + TrayIconAppearance = "colorful"; + }; + + Security = { + ClearClipboardTimeout = 15; + EnableCopyOnDoubleClick = true; + IconDownloadFallback = true; + LockDatabaseScreenLock = false; + }; + + SSHAgent = { + Enabled = true; + }; + }; + }; neofetch.enable = true; neovim.enable = true; tmux.enable = true;