From e3c1b632e19913db3502f1fe68e98f2b7fe00397 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Sun, 1 Dec 2024 14:49:56 +0530 Subject: [PATCH] set data folder for vaultwarden --- modules/vaultwarden.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/vaultwarden.nix b/modules/vaultwarden.nix index 7b918c0..4969a60 100644 --- a/modules/vaultwarden.nix +++ b/modules/vaultwarden.nix @@ -8,7 +8,17 @@ in enable = lib.mkEnableOption "vaultwarden"; config = lib.mkOption { - type = lib.types.attrsOf lib.types.str; + type = lib.types.submodule { + freeformType = lib.types.attrsOf lib.types.str; + options = { + DATA_FOLDER = lib.mkOption { + type = lib.types.str; + default = "/var/lib/vaultwarden/"; + readOnly = true; + description = "Data directory used by vaultwarden. it cannot be changed as it's using systemd's StateDirectory"; + }; + }; + }; description = "Vaultwarden is configured using environment variables"; default = { ROCKET_ADDRESS = "::1"; # default to localhost @@ -41,7 +51,7 @@ in wantedBy = [ "multi-user.target" ]; wants = [ "network-online.target" ]; after = [ "network-online.target" ]; - environment = cfg.environment; + environment = cfg.config; serviceConfig = { Type = "notify"; DynamicUser = true;