From 9b945b0a8486f31dc96602bbed308655c419ace1 Mon Sep 17 00:00:00 2001 From: "Giulio De Pasquale (aider)" Date: Sat, 26 Apr 2025 17:18:09 +0100 Subject: [PATCH] feat: port MinIO service to new modular services structure --- modules/services/default.nix | 1 + modules/services/minio/default.nix | 36 ++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 modules/services/minio/default.nix diff --git a/modules/services/default.nix b/modules/services/default.nix index 0e526b1..a50bf09 100644 --- a/modules/services/default.nix +++ b/modules/services/default.nix @@ -6,6 +6,7 @@ ./jellyfin ./jellyseer ./lidarr + ./minio ./navidrome ./nzbget ./prowlarr diff --git a/modules/services/minio/default.nix b/modules/services/minio/default.nix new file mode 100644 index 0000000..fc7a266 --- /dev/null +++ b/modules/services/minio/default.nix @@ -0,0 +1,36 @@ +{ config, lib, pkgs, ... }: + +let + inherit (lib) mkIf; + + cfg = config.pepe.services.minio; +in +{ + options.pepe.services.minio = with lib; { + enable = mkEnableOption "Enable MinIO S3-compatible object storage"; + package = mkPackageOption pkgs "minio" { default = pkgs.minio_legacy_fs; }; + domain = mkOption { + type = types.str; + default = null; + }; + }; + + config = mkIf cfg.enable { + services.minio = { + enable = true; + package = cfg.package; + }; + + pepe.core.vhost.hosts.${cfg.domain} = with config.pepe.core.network; { + dnsInterfaces = [ interfaceTypes.vpn interfaceTypes.lan ]; + locations."/" = { + port = 9000; + allowLAN = true; + allowVPN = true; + extraConfig = '' + client_max_body_size 500M; + ''; + }; + }; + }; +}