From 4bbb39f3c1b5710dc95948dbcd6bc773c161c226 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Thu, 20 Jun 2024 14:35:29 -0500 Subject: [PATCH] Setup minio properly --- hosts/genesis/networking.nix | 13 ------------- hosts/hosea/default.nix | 3 +-- hosts/hosea/minio.nix | 29 +++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 15 deletions(-) create mode 100644 hosts/hosea/minio.nix diff --git a/hosts/genesis/networking.nix b/hosts/genesis/networking.nix index b99aa67..dc87163 100644 --- a/hosts/genesis/networking.nix +++ b/hosts/genesis/networking.nix @@ -9,8 +9,6 @@ let adblockUpdate = pkgs.writeShellScriptBin "adblockUpdate" (builtins.readFile ./adblockUpdate.sh); proxyPort = 3128; - minioPort = 9000; - minioConsolePort = 9001; dnsPort = 53; dhcpPort = 67; dnsServers = [ @@ -62,8 +60,6 @@ in { ]; allowedTCPPorts = [ dnsPort - minioPort - minioConsolePort proxyPort 80 ]; @@ -191,15 +187,7 @@ in { "jellyfin.home".target = "http://localhost:8096/"; }; - age.secrets.minio.file = ../../secrets/minio.age; - services = { - minio = { - enable = true; - dataDir = [ "/proxy/minio" ]; - rootCredentialsFile = config.age.secrets.minio.path; - browser = true; - }; nginx.virtualHosts."nixcache.thehellings.lan" = { serverName = "nixcache.thehellings.lan"; serverAliases = [ "nixcache" "nixcache.home" ]; @@ -238,7 +226,6 @@ in { environment.systemPackages = with pkgs; [ bind curl # Used by dnsmasq fetching - minio-client sqlite ]; } diff --git a/hosts/hosea/default.nix b/hosts/hosea/default.nix index c6deb75..f4620e1 100644 --- a/hosts/hosea/default.nix +++ b/hosts/hosea/default.nix @@ -13,6 +13,7 @@ in imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ./minio.nix ]; @@ -66,8 +67,6 @@ in registrationConfigFile = config.age.secrets.runner-reg.path; environmentVariables = { EFI_DIR = "${pkgs.OVMF.fd}/FV/"; - #HTTP_PROXY = "http://10.42.1.4:3128/"; - #HTTPS_PROXY = "http://10.42.1.4:3128/"; }; }; }; diff --git a/hosts/hosea/minio.nix b/hosts/hosea/minio.nix new file mode 100644 index 0000000..65a042a --- /dev/null +++ b/hosts/hosea/minio.nix @@ -0,0 +1,29 @@ +{ config, pkgs, ... }: + +let + minioPort = 9000; + minioConsolePort = 9001; +in { + fileSystems."/proxy" = { + device = "/dev/sda1"; + fsType = "btrfs"; + }; + + networking.firewall.allowedTCPPorts = [ + minioPort + minioConsolePort + ]; + + age.secrets.minio.file = ../../secrets/minio.age; + + services.minio = { + enable = true; + dataDir = [ "/proxy/minio" ]; + rootCredentialsFile = config.age.secrets.minio.path; + browser = true; + }; + + environment.systemPackages = with pkgs; [ + minio-client + ]; +}