@@ -18,9 +18,9 @@ in
1818 };
1919
2020 dataDir = mkOption {
21− default = "/var/lib/minio/data";
22− type = types.path;
23− description = "The data directory, for storing the objects.";
21+ default = [ "/var/lib/minio/data" ];
22+ type = types.listOf types.path;
23+ description = "The list of data directories for storing the objects. Use one path for regular operation and the minimum of 4 endpoints for Erasure Code mode.";
2424 };
2525
2626 configDir = mkOption {
@@ -74,15 +74,14 @@ in
7474 config = mkIf cfg.enable {
7575 systemd.tmpfiles.rules = [
7676 "d '${cfg.configDir}' - minio minio - -"
77− "d '${cfg.dataDir}' - minio minio - -"
78− ];
77+ ] ++ (map (x: "d '" + x + "' - minio minio - - ") cfg.dataDir);
7978
8079 systemd.services.minio = {
8180 description = "Minio Object Storage";
8281 after = [ "network.target" ];
8382 wantedBy = [ "multi-user.target" ];
8483 serviceConfig = {
85− ExecStart = "${cfg.package}/bin/minio server --json --address ${cfg.listenAddress} --config-dir=${cfg.configDir} ${cfg.dataDir}";
84+ ExecStart = "${cfg.package}/bin/minio server --json --address ${cfg.listenAddress} --config-dir=${cfg.configDir} ${toString cfg.dataDir}";
8685 Type = "simple";
8786 User = "minio";
8887 Group = "minio";