From 61a41173629bf633fbd61549b4a3924b72215afc Mon Sep 17 00:00:00 2001 From: kat Date: Thu, 6 Oct 2022 10:19:53 -0700 Subject: [PATCH] fix: misc minio fixes --- nixos/systems/tewi/nixos.nix | 1 + services/minio.nix | 19 ++++++++++--------- tf | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/nixos/systems/tewi/nixos.nix b/nixos/systems/tewi/nixos.nix index b886bfc2..0f67552b 100644 --- a/nixos/systems/tewi/nixos.nix +++ b/nixos/systems/tewi/nixos.nix @@ -6,6 +6,7 @@ hardware.local nixos.network services.cockroachdb + services.minio ./kanidm.nix ./vouch.nix ./home-assistant.nix diff --git a/services/minio.nix b/services/minio.nix index 2a53bec9..7e678da5 100644 --- a/services/minio.nix +++ b/services/minio.nix @@ -1,8 +1,10 @@ -{ config, lib, ... }: let - import (lib.modules) mkIf mkDefault; +{ config, lib, tf, ... }: let + inherit (lib.modules) mkIf mkDefault; + inherit (lib.options) mkEnableOption; + inherit (lib.attrsets) mapAttrs' genAttrs nameValuePair; cfg = config.services.minio; in { - options.services.minio.isNAS = mkEnableFunction "NAS lack of defaults"; + options.services.minio.isNAS = mkEnableOption "NAS lack of defaults"; config = { secrets = { @@ -10,7 +12,6 @@ in { path = "gensokyo/minio"; field = "${name}-key"; })); - }; files = { minio-root-credentials = { text = '' @@ -23,17 +24,17 @@ in { }; }; - systemd.tmpfiles.rules = mkIf !cfg.isNAS '' - v /minio 700 minio minio - ''; + systemd.tmpfiles.rules = mkIf (!cfg.isNAS) [ + "v /minio 700 minio minio" + ]; services = { minio = { region = config.services.cockroachdb.locality; enable = true; - dataDir = lib.optional !cfg.isNAS "/minio"; + dataDir = lib.optional (!cfg.isNAS) "/minio"; listenAddress = "${config.networks.tailscale.ipv4}:9000"; - consoleAddress = "${config.networks.tailcale.ipv4}:9001"; + consoleAddress = "${config.networks.tailscale.ipv4}:9001"; rootCredentialsFile = config.secrets.files.minio-root-credentials.path; }; }; diff --git a/tf b/tf index 350586e1..426f3bb0 160000 --- a/tf +++ b/tf @@ -1 +1 @@ -Subproject commit 350586e12aeea00229c99fb2059dadac56934358 +Subproject commit 426f3bb0ceaf3fc1495ebe14f90697aaab19e1aa