set data folder for vaultwarden
Some checks failed
Build and Push to Cachix / Push to Binary Cache (X86-64) (push) Failing after 3m15s
Build and Push to Cachix / Push to Binary Cache (aarch64) (push) Successful in 14m17s

This commit is contained in:
Adithya 2024-12-01 14:49:56 +05:30
parent 5c0042d455
commit e3c1b632e1
Signed by: adtya
GPG key ID: B8857BFBA2C47B9C

View file

@ -8,7 +8,17 @@ in
enable = lib.mkEnableOption "vaultwarden"; enable = lib.mkEnableOption "vaultwarden";
config = lib.mkOption { 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"; description = "Vaultwarden is configured using environment variables";
default = { default = {
ROCKET_ADDRESS = "::1"; # default to localhost ROCKET_ADDRESS = "::1"; # default to localhost
@ -41,7 +51,7 @@ in
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ]; wants = [ "network-online.target" ];
after = [ "network-online.target" ]; after = [ "network-online.target" ];
environment = cfg.environment; environment = cfg.config;
serviceConfig = { serviceConfig = {
Type = "notify"; Type = "notify";
DynamicUser = true; DynamicUser = true;