diff options
author | figsoda <figsoda@pm.me> | 2022-11-16 12:57:04 -0500 |
---|---|---|
committer | figsoda <figsoda@pm.me> | 2022-11-17 12:54:28 -0500 |
commit | d1dd00b61823e8e98fe44262090b560eee45b344 (patch) | |
tree | e282f9e83ae6957386b4a69301b525d5e61ddfa1 /nixos | |
parent | f4828b40fde0b39afc5dc9b147baa60cb2a6ca47 (diff) | |
download | nixlib-d1dd00b61823e8e98fe44262090b560eee45b344.tar nixlib-d1dd00b61823e8e98fe44262090b560eee45b344.tar.gz nixlib-d1dd00b61823e8e98fe44262090b560eee45b344.tar.bz2 nixlib-d1dd00b61823e8e98fe44262090b560eee45b344.tar.lz nixlib-d1dd00b61823e8e98fe44262090b560eee45b344.tar.xz nixlib-d1dd00b61823e8e98fe44262090b560eee45b344.tar.zst nixlib-d1dd00b61823e8e98fe44262090b560eee45b344.zip |
nixos/vaultwarden: use lib.concatMapAttrs
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/security/vaultwarden/default.nix | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/nixos/modules/services/security/vaultwarden/default.nix b/nixos/modules/services/security/vaultwarden/default.nix index 81423e57fd2c..3ef0bfb090ac 100644 --- a/nixos/modules/services/security/vaultwarden/default.nix +++ b/nixos/modules/services/security/vaultwarden/default.nix @@ -22,9 +22,9 @@ let # we can only check for values consistently after converting them to their corresponding environment variable name. configEnv = let - configEnv = listToAttrs (concatLists (mapAttrsToList (name: value: - if value != null then [ (nameValuePair (nameToEnvVar name) (if isBool value then boolToString value else toString value)) ] else [] - ) cfg.config)); + configEnv = concatMapAttrs (name: value: optionalAttrs (value != null) { + ${nameToEnvVar name} = if isBool value then boolToString value else toString value; + }) cfg.config; in { DATA_FOLDER = "/var/lib/bitwarden_rs"; } // optionalAttrs (!(configEnv ? WEB_VAULT_ENABLED) || configEnv.WEB_VAULT_ENABLED == "true") { WEB_VAULT_FOLDER = "${cfg.webVaultPackage}/share/vaultwarden/vault"; } // configEnv; |