From e9993d139ce2ebddc6ffc369bc8b5215056e6634 Mon Sep 17 00:00:00 2001 From: Magic_RB Date: Thu, 29 Jun 2023 20:10:19 +0200 Subject: [PATCH] add store_path to matrix containers Signed-off-by: Magic_RB --- terranix/containers/matrix/default.nix | 14 +++++++++++++- .../matrix/matrix-mautrix-discord.hcl | 5 +++++ .../matrix/matrix-mautrix-facebook.hcl | 5 +++++ .../matrix/matrix-mautrix-signal.hcl | 5 +++++ terranix/containers/matrix/matrix-synapse.hcl | 19 +++++++++++++++++++ 5 files changed, 47 insertions(+), 1 deletion(-) diff --git a/terranix/containers/matrix/default.nix b/terranix/containers/matrix/default.nix index b815bea..2177e9d 100644 --- a/terranix/containers/matrix/default.nix +++ b/terranix/containers/matrix/default.nix @@ -140,6 +140,15 @@ in vars = { flake_ref = "${vars.flake_host}?ref=${vars.flake_ref}&rev=${vars.flake_rev}"; flake_sha = vars.flake_sha; + store_path = builtins.toJSON (builtins.mapAttrs (_: builtins.unsafeDiscardStringContext) { + synapse = config'.flake.nixngConfigurations.synapse.config.system.build.toplevel; + synapseClient = config'.flake.nixngConfigurations.synapseClient.config.system.build.toplevel; + synapseSync = config'.flake.nixngConfigurations.synapseSync.config.system.build.toplevel; + synapseFederationSender = config'.flake.nixngConfigurations.synapseFederationSender.config.system.build.toplevel; + synapseFederationReceiver = config'.flake.nixngConfigurations.synapseFederationReceiver.config.system.build.toplevel; + postgresql = config'.flake.nixngConfigurations.synapsePostgreSQL.config.system.build.toplevel; + redis = config'.flake.nixngConfigurations.synapseRedis.config.system.build.toplevel; + }); }; }; @@ -148,6 +157,7 @@ in vars = { flake_ref = "${vars.flake_host}?ref=${vars.flake_ref}&rev=${vars.flake_rev}"; flake_sha = vars.flake_sha; + store_path = builtins.unsafeDiscardStringContext config'.flake.nixngConfigurations.mautrixDiscord.config.system.build.toplevel; }; }; @@ -156,6 +166,7 @@ in vars = { flake_ref = "${vars.flake_host}?ref=${vars.flake_ref}&rev=${vars.flake_rev}"; flake_sha = vars.flake_sha; + store_path = builtins.unsafeDiscardStringContext config'.flake.nixngConfigurations.mautrixFacebook.config.system.build.toplevel; }; }; @@ -164,6 +175,7 @@ in vars = { flake_ref = "${vars.flake_host}?ref=${vars.flake_ref}&rev=${vars.flake_rev}"; flake_sha = vars.flake_sha; + store_path = builtins.unsafeDiscardStringContext config'.flake.nixngConfigurations.mautrixSignal.config.system.build.toplevel; }; }; @@ -173,7 +185,7 @@ in vars = { flake_ref = "${vars.flake_host}?ref=${vars.flake_ref}&rev=${vars.flake_rev}"; flake_sha = vars.flake_sha; - store_path = config'.flake.nixngConfigurations.heisenbridge.config.system.build.toplevel; + store_path = builtins.unsafeDiscardStringContext config'.flake.nixngConfigurations.heisenbridge.config.system.build.toplevel; }; }; } diff --git a/terranix/containers/matrix/matrix-mautrix-discord.hcl b/terranix/containers/matrix/matrix-mautrix-discord.hcl index f52e6ad..72e2029 100644 --- a/terranix/containers/matrix/matrix-mautrix-discord.hcl +++ b/terranix/containers/matrix/matrix-mautrix-discord.hcl @@ -6,6 +6,10 @@ variable "flake_sha" { type = string } +variable "store_path" { + type = string +} + job "matrix-mautrix-discord" { datacenters = [ "homelab-1" ] type = "service" @@ -83,6 +87,7 @@ job "matrix-mautrix-discord" { config { nix_flake_ref = "${var.flake_ref}#nixngConfigurations.mautrixDiscord.config.system.build.toplevel" nix_flake_sha = var.flake_sha + nix_flake_store_path = var.store_path entrypoint = [ "init" ] } diff --git a/terranix/containers/matrix/matrix-mautrix-facebook.hcl b/terranix/containers/matrix/matrix-mautrix-facebook.hcl index 6d84d18..8c542d9 100644 --- a/terranix/containers/matrix/matrix-mautrix-facebook.hcl +++ b/terranix/containers/matrix/matrix-mautrix-facebook.hcl @@ -6,6 +6,10 @@ variable "flake_sha" { type = string } +variable "store_path" { + type = string +} + job "matrix-mautrix-facebook" { datacenters = [ "homelab-1" ] type = "service" @@ -76,6 +80,7 @@ job "matrix-mautrix-facebook" { config { nix_flake_ref = "${var.flake_ref}#nixngConfigurations.mautrixFacebook.config.system.build.toplevel" nix_flake_sha = var.flake_sha + nix_flake_store_path = var.store_path entrypoint = [ "init" ] } diff --git a/terranix/containers/matrix/matrix-mautrix-signal.hcl b/terranix/containers/matrix/matrix-mautrix-signal.hcl index 6e5e63b..4017beb 100644 --- a/terranix/containers/matrix/matrix-mautrix-signal.hcl +++ b/terranix/containers/matrix/matrix-mautrix-signal.hcl @@ -6,6 +6,10 @@ variable "flake_sha" { type = string } +variable "store_path" { + type = string +} + job "matrix-mautrix-signal" { datacenters = [ "homelab-1" ] type = "service" @@ -98,6 +102,7 @@ job "matrix-mautrix-signal" { config { nix_flake_ref = "${var.flake_ref}#nixngConfigurations.mautrixSignal.config.system.build.toplevel" nix_flake_sha = var.flake_sha + nix_flake_store_path = var.store_path entrypoint = [ "init" ] } diff --git a/terranix/containers/matrix/matrix-synapse.hcl b/terranix/containers/matrix/matrix-synapse.hcl index 12334dd..86226fb 100644 --- a/terranix/containers/matrix/matrix-synapse.hcl +++ b/terranix/containers/matrix/matrix-synapse.hcl @@ -6,6 +6,18 @@ variable "flake_sha" { type = string } +variable "store_path" { + type = object({ + synapseClient = string + synapseSync = string + synapseFederationSender = string + synapseFederationReceiver = string + synapse = string + postgresql = string + redis = string + }) +} + job "matrix-synapse" { datacenters = [ "homelab-1" ] type = "service" @@ -65,6 +77,7 @@ job "matrix-synapse" { config { nix_flake_ref = "${var.flake_ref}#nixngConfigurations.synapseRedis.config.system.build.toplevel" nix_flake_sha = var.flake_sha + nix_flake_store_path = var.store_path.redis entrypoint = [ "init" ] } @@ -186,6 +199,7 @@ EOF config { nix_flake_ref = "${var.flake_ref}#nixngConfigurations.synapseClient.config.system.build.toplevel" nix_flake_sha = var.flake_sha + nix_flake_store_path = var.store_path.synapseClient entrypoint = [ "init" ] } @@ -331,6 +345,7 @@ EOF config { nix_flake_ref = "${var.flake_ref}#nixngConfigurations.synapseSync.config.system.build.toplevel" nix_flake_sha = var.flake_sha + nix_flake_store_path = var.store_path.synapseSync entrypoint = [ "init" ] } @@ -476,6 +491,7 @@ EOF config { nix_flake_ref = "${var.flake_ref}#nixngConfigurations.synapseFederationReceiver.config.system.build.toplevel" nix_flake_sha = var.flake_sha + nix_flake_store_path = var.store_path.synapseFederationReceiver entrypoint = [ "init" ] } @@ -621,6 +637,7 @@ EOF config { nix_flake_ref = "${var.flake_ref}#nixngConfigurations.synapseFederationSender.config.system.build.toplevel" nix_flake_sha = var.flake_sha + nix_flake_store_path = var.store_path.synapseFederationSender entrypoint = [ "init" ] } @@ -705,6 +722,7 @@ EOF config { nix_flake_ref = "${var.flake_ref}#nixngConfigurations.synapsePostgreSQL.config.system.build.toplevel" nix_flake_sha = var.flake_sha + nix_flake_store_path = var.store_path.postgresql entrypoint = [ "init" ] } @@ -847,6 +865,7 @@ EOF config { nix_flake_ref = "${var.flake_ref}#nixngConfigurations.synapse.config.system.build.toplevel" nix_flake_sha = var.flake_sha + nix_flake_store_path = var.store_path.synapse entrypoint = [ "init" ] }