From eceb1ba89238dbbf719f0c1f405f375ad8122804 Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Sun, 19 Feb 2023 16:49:07 +0000 Subject: [PATCH] nixos/object: Migrate to SNSD deployment --- .../colony/vms/shill/containers/object.nix | 19 ++++++++++++++++--- secrets/object/minio-client-config.json.age | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 secrets/object/minio-client-config.json.age diff --git a/nixos/boxes/colony/vms/shill/containers/object.nix b/nixos/boxes/colony/vms/shill/containers/object.nix index 1e7dd59..f4b7301 100644 --- a/nixos/boxes/colony/vms/shill/containers/object.nix +++ b/nixos/boxes/colony/vms/shill/containers/object.nix @@ -18,6 +18,7 @@ configuration = { lib, pkgs, config, assignments, ... }: let inherit (lib) mkMerge mkIf; + inherit (config.my.user.homeConfig.lib.file) mkOutOfStoreSymlink; inherit (lib.my) networkdAssignment; in { @@ -35,12 +36,20 @@ owner = "sharry"; group = "sharry"; }; + "object/minio-client-config.json" = { + owner = config.my.user.config.name; + group = config.my.user.config.group; + }; }; }; firewall = { tcp.allowed = [ 9000 9001 config.services.sharry.config.bind.port ]; }; + + user.homeConfig = { + home.file.".mc/config.json".source = mkOutOfStoreSymlink config.age.secrets."object/minio-client-config.json".path; + }; }; systemd = { @@ -57,6 +66,12 @@ }; }; + environment = { + systemPackages = with pkgs; [ + minio-client + ]; + }; + services = { minio = { enable = true; @@ -64,12 +79,10 @@ browser = true; rootCredentialsFile = config.age.secrets."object/minio.env".path; dataDir = [ "/mnt/minio" ]; - - # TODO: Migrate from fs to snsd backend! - package = pkgs.minio_legacy_fs; }; sharry = { + # TODO: wait for postgres connection to succeed enable = true; configOverridesFile = config.age.secrets."object/sharry.conf".path; diff --git a/secrets/object/minio-client-config.json.age b/secrets/object/minio-client-config.json.age new file mode 100644 index 0000000..4b38627 --- /dev/null +++ b/secrets/object/minio-client-config.json.age @@ -0,0 +1,18 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWd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