+23
-22
nixos/modules/services/security/vault.nix
+23
-22
nixos/modules/services/security/vault.nix
······-type = types.enum ["inmem" "inmem_transactional" "inmem_ha" "inmem_transactional_ha" "file_transactional" "consul" "zookeeper" "file" "s3" "azure" "dynamodb" "etcd" "mssql" "mysql" "postgresql" "swift" "gcs"];+type = types.enum [ "inmem" "file" "consul" "zookeeper" "s3" "azure" "dynamodb" "etcd" "mssql" "mysql" "postgresql" "swift" "gcs" ];-default = if (cfg.storageBackend == "file" || cfg.storageBackend == "file_transactional") then ''···-localDir = if (cfg.storageBackend == "file" || cfg.storageBackend == "file_transactional") then+{ assertion = cfg.storageBackend == "inmem" -> (cfg.storagePath == null && cfg.storageConfig == null);+message = ''The "inmem" storage expects no services.vault.storagePath nor services.vault.storageConfig'';+{ assertion = (cfg.storageBackend == "file" -> (cfg.storagePath != null && cfg.storageConfig == null)) && (cfg.storagePath != null -> cfg.storageBackend == "file");···++ optional (config.services.consul.enable && cfg.storageBackend == "consul") "consul.service";···