From e345fad13314fe41e7741b8e34b0b296e37e80a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Neumann?= Date: Fri, 26 Sep 2025 14:03:40 +0200 Subject: [PATCH] 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. --- nixos/modules/services/security/vaultwarden/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/security/vaultwarden/default.nix b/nixos/modules/services/security/vaultwarden/default.nix index e15f8a2eeeb1..5bcd5eee6324 100644 --- a/nixos/modules/services/security/vaultwarden/default.nix +++ b/nixos/modules/services/security/vaultwarden/default.nix @@ -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 = [ "" ];