From 39fb7f794d42824d2f8241d4fab31a1ec4d8c2d0 Mon Sep 17 00:00:00 2001 From: Fabrice Bellamy <12b@distrilab.fr> Date: Sun, 22 Dec 2024 19:57:51 +0100 Subject: [PATCH] Add excalidraw to arachnide server --- config/arachnide/configuration.nix | 5 +++++ modules/etherpad.nix | 2 +- modules/excalidraw.nix | 33 ++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 modules/excalidraw.nix diff --git a/config/arachnide/configuration.nix b/config/arachnide/configuration.nix index 01f9086..bd6942b 100644 --- a/config/arachnide/configuration.nix +++ b/config/arachnide/configuration.nix @@ -15,6 +15,7 @@ /var/src/modules/forgejo-runner.nix /var/src/modules/nextcloud.nix /var/src/modules/etherpad.nix + /var/src/modules/excalidraw.nix ]; # Bootloader. @@ -75,6 +76,10 @@ domain = "pad.lab12.fr"; }; + nixin.excalidraw = { + domain = "draw.lab12.fr"; + }; + # Enable ip forwarding to route packets for the local network connected to enp3s0 boot.kernel.sysctl = { diff --git a/modules/etherpad.nix b/modules/etherpad.nix index d742dc5..aa88173 100644 --- a/modules/etherpad.nix +++ b/modules/etherpad.nix @@ -16,7 +16,7 @@ in "127.0.0.1" = [ "${config.nixin.etherpad.domain}" ]; }; - # Etherpad is not yes packaged for nixos, so deploy it using docker + # Etherpad is not yes packaged for nixos, so we deploy it using docker virtualisation.oci-containers.containers.etherpad = { autoStart = true; image = "etherpad/etherpad"; diff --git a/modules/excalidraw.nix b/modules/excalidraw.nix new file mode 100644 index 0000000..1ed7e15 --- /dev/null +++ b/modules/excalidraw.nix @@ -0,0 +1,33 @@ +# Forgejo +{ config, pkgs, lib, ... }: + +let + inherit (lib) mkOption mkDefault; +in +{ + options = { + nixin.excalidraw = { + domain = mkOption { type = lib.types.str; }; + }; + }; + + config = { + networking.hosts = { + "127.0.0.1" = [ "${config.nixin.excalidraw.domain}" ]; + }; + + # Excalidraw is not yes packaged for nixos, so we deploy it using docker + virtualisation.oci-containers.containers.excalidraw = { + autoStart = true; + image = "docker.io/excalidraw/excalidraw:latest"; + extraOptions = [ + "--label=traefik.enable=true" + "--label=traefik.http.routers.excalidraw.entrypoints=websecure" + "--label=traefik.http.routers.excalidraw.rule=Host(`${config.nixin.excalidraw.domain}`)" + "--label=traefik.http.routers.excalidraw.tls=true" + "--label=traefik.http.services.excalidraw.loadbalancer.server.port=80" + "--label=traefik.http.routers.excalidraw.tls.certresolver=acme-challenge" + ]; + }; + }; +}