Install keepassxc

- My password databases are kept in keepassxc: I'll install it so that we can
  get everything later
diff --git a/modules/keepassxc.nix b/modules/keepassxc.nix
new file mode 100644
index 0000000..8173422
--- /dev/null
+++ b/modules/keepassxc.nix
@@ -0,0 +1,31 @@
+{
+  pkgs,
+  home,
+  config,
+  username,
+  ...
+}: {
+  home = {
+    home.packages = [pkgs.keepassxc];
+    wayland.windowManager.sway.config.startup = [
+      {
+        command = builtins.replaceStrings ["\n"] [" "] ''
+          ${pkgs.coreutils}/bin/cat
+          ${config.sops.secrets.keepassPassword.path} |
+          ${pkgs.keepassxc}/bin/keepassxc --pw-stdin
+          ${home.home.homeDirectory}/Sync/KeePass\ Vaults/Passwords.kdbx
+        '';
+      }
+    ];
+  };
+  config = {
+    environment.persistence."/nix/persist".users.${username}.directories = [
+      ".config/keepassxc"
+    ];
+    sops.secrets.keepassPassword = {
+      mode = "0400";
+      owner = config.users.users.${username}.name;
+      group = config.users.users.nobody.group;
+    };
+  };
+}