From 920fdd7504e9e32d9f980b9f13514fcbe602d430 Mon Sep 17 00:00:00 2001 From: cy Date: Mon, 23 Dec 2024 21:11:08 -0500 Subject: [PATCH] add element-web container --- hosts/chunk/Caddyfile | 5 +++++ hosts/chunk/default.nix | 1 + hosts/chunk/element.nix | 25 +++++++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 hosts/chunk/element.nix diff --git a/hosts/chunk/Caddyfile b/hosts/chunk/Caddyfile index 23e6730..4ddaaf2 100644 --- a/hosts/chunk/Caddyfile +++ b/hosts/chunk/Caddyfile @@ -75,3 +75,8 @@ grafana.cything.io { import common reverse_proxy localhost:8088 } + +element.cything.io { + import common + reverse_proxy localhost:8089 +} diff --git a/hosts/chunk/default.nix b/hosts/chunk/default.nix index bf8bc98..0b17cb0 100644 --- a/hosts/chunk/default.nix +++ b/hosts/chunk/default.nix @@ -25,6 +25,7 @@ ./ghost.nix ./conduit.nix ./immich.nix + ./element.nix ]; sops.age.keyFile = "/root/.config/sops/age/keys.txt"; diff --git a/hosts/chunk/element.nix b/hosts/chunk/element.nix new file mode 100644 index 0000000..958666e --- /dev/null +++ b/hosts/chunk/element.nix @@ -0,0 +1,25 @@ +{ + pkgs, + config, + ... +}: +{ + virtualisation.oci-containers.containers.element = { + image = "vectorim/element-web"; + autoStart = true; + ports = [ "127.0.0.1:8089:80" ]; + pull = "newer"; + networks = [ "element-net" ]; + }; + + systemd.services.create-element-net = { + serviceConfig.Type = "oneshot"; + wantedBy = with config.virtualisation.oci-containers; [ + "${backend}-element.service" + ]; + script = '' + ${pkgs.podman}/bin/podman network exists element-net || \ + ${pkgs.podman}/bin/podman network create element-net + ''; + }; +}