nixos-config/machines/chungus/service-s3.nix
2025-02-23 16:26:59 +07:00

40 lines
1,016 B
Nix

{ config, factsGenerator, ... }:
{
healthchecks.http.s3 = {
url = "http://s3.chungus.private:9001/login";
expectedContent = "minio";
};
clan.core.facts.services.s3 = factsGenerator.password {
name = "root";
service = "s3";
};
services.minio = {
enable = true;
region = "home";
# this file was adjusted right after creation
# MINIO_ROOT_USER=root
# MINIO_ROOT_PASSWORD=<the password>
rootCredentialsFile = config.clan.core.facts.services.s3.secret."s3.root".path;
};
services.nginx = {
enable = true;
virtualHosts."s3.${config.networking.hostName}.private" = {
locations."/" = {
recommendedProxySettings = true;
proxyWebsockets = true;
proxyPass = "http://localhost:9000";
};
};
virtualHosts."minio.${config.networking.hostName}.private" = {
locations."/" = {
recommendedProxySettings = true;
proxyWebsockets = true;
proxyPass = "http://localhost:9001";
};
};
};
}