nixos/vaultwarden: Allow multiple environment files

Change type of `environmentFile` to also allow passing a list of paths
in order to have multiple environment files.
This commit is contained in:
René Neumann
2025-10-01 17:37:38 +02:00
parent 24a75e9c80
commit e345fad133
@@ -172,11 +172,11 @@ in
};
environmentFile = lib.mkOption {
type = with lib.types; nullOr path;
default = null;
type = with lib.types; coercedTo path lib.singleton (listOf path);
default = [ ];
example = "/var/lib/vaultwarden.env";
description = ''
Additional environment file as defined in {manpage}`systemd.exec(5)`.
Additional environment file or files as defined in {manpage}`systemd.exec(5)`.
Secrets like {env}`ADMIN_TOKEN` and {env}`SMTP_PASSWORD`
should be passed to the service without adding them to the world-readable Nix store.
@@ -225,7 +225,7 @@ in
serviceConfig = {
User = user;
Group = group;
EnvironmentFile = [ configFile ] ++ lib.optional (cfg.environmentFile != null) cfg.environmentFile;
EnvironmentFile = [ configFile ] ++ cfg.environmentFile;
ExecStart = lib.getExe vaultwarden;
LimitNOFILE = "1048576";
CapabilityBoundingSet = [ "" ];