Add excalidraw to arachnide server

This commit is contained in:
Douze Bé 2024-12-22 19:57:51 +01:00
parent f3603eec25
commit 39fb7f794d
3 changed files with 39 additions and 1 deletions

View file

@ -15,6 +15,7 @@
/var/src/modules/forgejo-runner.nix /var/src/modules/forgejo-runner.nix
/var/src/modules/nextcloud.nix /var/src/modules/nextcloud.nix
/var/src/modules/etherpad.nix /var/src/modules/etherpad.nix
/var/src/modules/excalidraw.nix
]; ];
# Bootloader. # Bootloader.
@ -75,6 +76,10 @@
domain = "pad.lab12.fr"; domain = "pad.lab12.fr";
}; };
nixin.excalidraw = {
domain = "draw.lab12.fr";
};
# Enable ip forwarding to route packets for the local network connected to enp3s0 # Enable ip forwarding to route packets for the local network connected to enp3s0
boot.kernel.sysctl = { boot.kernel.sysctl = {

View file

@ -16,7 +16,7 @@ in
"127.0.0.1" = [ "${config.nixin.etherpad.domain}" ]; "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 = { virtualisation.oci-containers.containers.etherpad = {
autoStart = true; autoStart = true;
image = "etherpad/etherpad"; image = "etherpad/etherpad";

33
modules/excalidraw.nix Normal file
View file

@ -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"
];
};
};
}