From 36a13c3e66be7378beda0d0015dd0cc73c84d61a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Wed, 26 Jan 2022 12:22:14 +0100 Subject: [PATCH] add custom minio systemd service --- config/services/minio.nix | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/config/services/minio.nix b/config/services/minio.nix index c3ee846b..3f0506e9 100644 --- a/config/services/minio.nix +++ b/config/services/minio.nix @@ -4,7 +4,7 @@ let in { services.minio = { - enable = true; + enable = false; rootCredentialsFile = "/run/secrets/security/minio/credentials_file"; }; services.nginx.virtualHosts."minio.int.chir.rs" = { @@ -30,12 +30,23 @@ in }; }; sops.secrets."security/minio/credentials_file" = { }; - systemd.services.minio.serviceConfig.ExecStart = "${pkgs.minio}/bin/minio gateway s3 --json --address :9000 --console-address :9001 --config-dir=/var/lib/minio/config http://[fd00:e621:e621:2::2]:9000"; - systemd.services.minio.environment = { - MINIO_CACHE = "on"; - MINIO_CACHE_DRIVES = "/var/cache/minio"; - MINIO_CACHE_QUOTA = "80"; - MINIO_CACHE_WATERMARK_LOW = "70"; - MINIO_CACHE_WATERMARK_HIGH = "90"; + systemd.services.minio = { + enable = true; + description = "Minio Object Storage"; + after = [ "network.target" ]; + environment = { + MINIO_BROWSER = "on"; + MINIO_REGION = "eu-west-1"; + MINIO_CACHE = "on"; + MINIO_CACHE_DRIVES = "/var/cache/minio"; + MINIO_CACHE_QUOTA = "80"; + MINIO_CACHE_WATERMARK_LOW = "70"; + MINIO_CACHE_WATERMARK_HIGH = "90"; + }; + serviceConfig = { + EnvironmentFile = "/run/secrets/security/minio/credentials_file"; + ExecStart = "${pkgs.minio}/bin/minio gateway s3 --json --address :9000 --console-address :9001 --config-dir=/var/lib/minio/config http://[fd00:e621:e621:2::2]:9000"; + }; + wantedBy = [ "multi-user.target" ]; }; }