34 lines
984 B
Nix
34 lines
984 B
Nix
|
# 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"
|
||
|
];
|
||
|
};
|
||
|
};
|
||
|
}
|