diff --git a/container/matrix/config.nix b/container/matrix/config.nix new file mode 100644 index 0000000..9497adf --- /dev/null +++ b/container/matrix/config.nix @@ -0,0 +1,35 @@ +{ + systemd.tmpfiles.rules = [ + "d /etc/container-matrix/telegram 0775 1337 1337" + "d /etc/container-matrix/signald 0775 0 0" + "d /etc/container-matrix/signal 0775 1337 1337" + "d /etc/container-matrix/whatsapp 0775 1337 1337" + ]; + + # Matrix: Telegram + + environment.etc."container-matrix/telegram/config.yaml" = { + source = ../../secret/container/matrix/config/telegram.yaml; + mode = "0640"; + uid = 1337; + gid = 1337; + }; + + # Matrix: Signal + + environment.etc."container-matrix/signal/config.yaml" = { + source = ../../secret/container/matrix/config/signal.yaml; + mode = "0640"; + uid = 1337; + gid = 1337; + }; + + # Matrix: WhatsApp + + environment.etc."container-matrix/whatsapp/config.yaml" = { + source = ../../secret/container/matrix/config/whatsapp.yaml; + mode = "0640"; + uid = 1337; + gid = 1337; + }; +} diff --git a/container/matrix/default.nix b/container/matrix/default.nix new file mode 100644 index 0000000..460fe14 --- /dev/null +++ b/container/matrix/default.nix @@ -0,0 +1,80 @@ +let + secret = import ../../secret/container/matrix; + custom-config = import ./config.nix { inherit secret; }; +in +{ + virtualisation.arion.projects.matrix.settings = { + services = { + matrix-telegram = { + service = { + image = "dock.mau.dev/mautrix/telegram:latest"; + container_name = "mautrix-telegram"; + restart = "unless-stopped"; + ports = [ "29317:29317" ]; + volumes = [ + "/etc/container-matrix/telegram:/data" + ]; + labels = { + "com.centurylinklabs.watchtower.enable" = "true"; + }; + }; + }; + + # signald = { + # service = { + # image = "signald/signald:latest"; + # container_name = "signald"; + # restart = "unless-stopped"; + # depends_on = [ "ipv6nat" ]; + # networks = [ "webserver" ]; + # volumes = [ + # "/etc/container-matrix/signald:/signald" + # ]; + # labels = { + # "com.centurylinklabs.watchtower.enable" = "true"; + # }; + # }; + # }; + # + # matrix-signal = { + # service = { + # image = "dock.mau.dev/mautrix/signal:latest"; + # container_name = "mautrix-signal"; + # restart = "unless-stopped"; + # depends_on = [ + # "ipv6nat" + # "synapse" + # "signald" + # ]; + # networks = [ "webserver" ]; + # volumes = [ + # "/etc/container-matrix/signal:/data" + # "/etc/container-matrix/signald:/signald" + # ]; + # labels = { + # "com.centurylinklabs.watchtower.enable" = "true"; + # }; + # }; + # }; + # + # matrix-whatsapp = { + # service = { + # image = "dock.mau.dev/mautrix/whatsapp:latest"; + # container_name = "mautrix-whatsapp"; + # restart = "unless-stopped"; + # depends_on = [ + # "ipv6nat" + # "synapse" + # ]; + # networks = [ "webserver" ]; + # volumes = [ + # "/etc/container-matrix/whatsapp:/data" + # ]; + # labels = { + # "com.centurylinklabs.watchtower.enable" = "true"; + # }; + # }; + # }; + }; + }; +} // custom-config diff --git a/container/webserver/config.nix b/container/webserver/config.nix index 8a6773b..664637a 100644 --- a/container/webserver/config.nix +++ b/container/webserver/config.nix @@ -4,11 +4,6 @@ systemd.tmpfiles.rules = [ "d /etc/container-webserver/weewx 0755 421 421" "d /etc/container-webserver/weewx/html 0755 421 421" - "d /etc/container-matrix/synapse 0755 991 991" - "d /etc/container-matrix/telegram 0775 1337 1337" - "d /etc/container-matrix/signald 0775 0 0" - "d /etc/container-matrix/signal 0775 1337 1337" - "d /etc/container-matrix/whatsapp 0775 1337 1337" ]; # mosquitto @@ -35,40 +30,4 @@ uid = 421; gid = 421; }; - - # Matrix: Synapse - - environment.etc."container-matrix/synapse/homeserver.yaml" = { - source = ../../secret/container/webserver/config/matrix/homeserver.yaml; - mode = "0640"; - uid = 991; - gid = 991; - }; - - # Matrix: Telegram - - environment.etc."container-matrix/telegram/config.yaml" = { - source = ../../secret/container/webserver/config/matrix/telegram.yaml; - mode = "0640"; - uid = 1337; - gid = 1337; - }; - - # Matrix: Signal - - environment.etc."container-matrix/signal/config.yaml" = { - source = ../../secret/container/webserver/config/matrix/signal.yaml; - mode = "0640"; - uid = 1337; - gid = 1337; - }; - - # Matrix: WhatsApp - - environment.etc."container-matrix/whatsapp/config.yaml" = { - source = ../../secret/container/webserver/config/matrix/whatsapp.yaml; - mode = "0640"; - uid = 1337; - gid = 1337; - }; } diff --git a/container/webserver/default.nix b/container/webserver/default.nix index d78835b..bddcea0 100644 --- a/container/webserver/default.nix +++ b/container/webserver/default.nix @@ -62,102 +62,6 @@ in labels = secret.container.webserver.weewx.labels; }; }; - - # Matrix - - # synapse = { - # service = { - # image = "matrixdotorg/synapse:latest"; - # container_name = "synapse"; - # restart = "unless-stopped"; - # depends_on = [ "ipv6nat" ]; - # networks = [ "webserver" ]; - # volumes = [ - # "/etc/container-matrix/synapse:/data" - # "/etc/container-matrix/telegram:/bridge-data/telegram:ro" - # "/etc/container-matrix/signal:/bridge-data/signal:ro" - # "/etc/container-matrix/whatsapp:/bridge-data/whatsapp:ro" - # ]; - # labels = { - # "com.centurylinklabs.watchtower.enable" = "true"; - # }; - # }; - # }; - # - # matrix-telegram = { - # service = { - # image = "dock.mau.dev/mautrix/telegram:latest"; - # container_name = "mautrix-telegram"; - # restart = "unless-stopped"; - # depends_on = [ - # "ipv6nat" - # "synapse" - # ]; - # networks = [ "webserver" ]; - # volumes = [ - # "/etc/container-matrix/telegram:/data" - # ]; - # labels = { - # "com.centurylinklabs.watchtower.enable" = "true"; - # }; - # }; - # }; - # - # signald = { - # service = { - # image = "signald/signald:latest"; - # container_name = "signald"; - # restart = "unless-stopped"; - # depends_on = [ "ipv6nat" ]; - # networks = [ "webserver" ]; - # volumes = [ - # "/etc/container-matrix/signald:/signald" - # ]; - # labels = { - # "com.centurylinklabs.watchtower.enable" = "true"; - # }; - # }; - # }; - # - # matrix-signal = { - # service = { - # image = "dock.mau.dev/mautrix/signal:latest"; - # container_name = "mautrix-signal"; - # restart = "unless-stopped"; - # depends_on = [ - # "ipv6nat" - # "synapse" - # "signald" - # ]; - # networks = [ "webserver" ]; - # volumes = [ - # "/etc/container-matrix/signal:/data" - # "/etc/container-matrix/signald:/signald" - # ]; - # labels = { - # "com.centurylinklabs.watchtower.enable" = "true"; - # }; - # }; - # }; - # - # matrix-whatsapp = { - # service = { - # image = "dock.mau.dev/mautrix/whatsapp:latest"; - # container_name = "mautrix-whatsapp"; - # restart = "unless-stopped"; - # depends_on = [ - # "ipv6nat" - # "synapse" - # ]; - # networks = [ "webserver" ]; - # volumes = [ - # "/etc/container-matrix/whatsapp:/data" - # ]; - # labels = { - # "com.centurylinklabs.watchtower.enable" = "true"; - # }; - # }; - # }; }; }; } // custom-config diff --git a/secret/container/webserver/config/matrix/signal.yaml b/secret/container/matrix/config/signal.yaml similarity index 100% rename from secret/container/webserver/config/matrix/signal.yaml rename to secret/container/matrix/config/signal.yaml diff --git a/secret/container/matrix/config/telegram.yaml b/secret/container/matrix/config/telegram.yaml new file mode 100644 index 0000000..81e7ce8 Binary files /dev/null and b/secret/container/matrix/config/telegram.yaml differ diff --git a/secret/container/webserver/config/matrix/whatsapp.yaml b/secret/container/matrix/config/whatsapp.yaml similarity index 100% rename from secret/container/webserver/config/matrix/whatsapp.yaml rename to secret/container/matrix/config/whatsapp.yaml diff --git a/secret/container/webserver/config/matrix/homeserver.yaml b/secret/container/webserver/config/matrix/homeserver.yaml deleted file mode 100644 index 55374ef..0000000 Binary files a/secret/container/webserver/config/matrix/homeserver.yaml and /dev/null differ diff --git a/secret/container/webserver/config/matrix/telegram.yaml b/secret/container/webserver/config/matrix/telegram.yaml deleted file mode 100644 index 2ba42f6..0000000 Binary files a/secret/container/webserver/config/matrix/telegram.yaml and /dev/null differ