diff --git a/homelab-services/minio-service/flake.nix b/homelab-services/minio-service/flake.nix index 005a46f..423aa22 100644 --- a/homelab-services/minio-service/flake.nix +++ b/homelab-services/minio-service/flake.nix @@ -87,7 +87,10 @@ forceSSL = true; enableACME = true; locations."/" = { - proxyPass = "http://localhost:${toString opts.port}"; + proxyPass = "http://localhost:${toString opts.dataPort}"; + }; + locations."/console" = { + proxyPass = "https://localhost:${toString opts.consolePort}"; }; }; }; diff --git a/nixos/configuration.nix b/nixos/configuration.nix index fb35c4f..f2de5bd 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -32,6 +32,11 @@ sopsFile = ./secrets/cloudflare.json; key = "CF_API_KEY"; }; + + "minio-root-pass" = { + sopsFile = ./secrets/minio.json; + key = "minioPass"; + }; }; }; @@ -72,6 +77,23 @@ }; }; + # Declare minio service manually + services.minio-service = { + enable = true; + + dataDir = "/data/minio"; + rootUser = "admin"; + rootPasswordFile = config.sops.secrets."minio-root-pass".path; + + dataPort = 9000; # S3 API access + consolePort = 9001; # Admin console access + + default-nginx = { + enable = true; + hostname = "imgs.roypository.com"; + }; + }; + # Grub Boot Loader Setup boot.loader.grub = { enable = true; diff --git a/nixos/flake.nix b/nixos/flake.nix index c8a5f3b..3c267fc 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -24,7 +24,7 @@ minio-service.url = "path:../homelab-services/minio-service"; }; - outputs = { self, nixpkgs, home-manager, disko, sops-nix, quasiSecrets, impermanence, tests-service }@inputs: + outputs = { self, nixpkgs, home-manager, disko, sops-nix, quasiSecrets, impermanence, tests-service, minio-service }@inputs: let nodes = [ { @@ -53,6 +53,7 @@ quasiSecrets.nixosModules.serviceList impermanence.nixosModules.impermanence tests-service.nixosModules.default + minio-service.nixosModules.default home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true;