{ config, containerCfg, pkgs, lib, builder, name,... }: let version = "latest"; serverCfg = config.syscfg.server; settings = pkgs.writers.writeYAML "settings.yaml" { title = "My Self-Hosted Dashboard"; base = ""; theme = "dark"; # layout = { # Infrastructure = { # style = "grid"; # columns = 3; # }; # }; }; services = pkgs.writers.writeYAML "services.yaml" [ {Media = lib.flatten [ (lib.optional (serverCfg.containers?jellyfin) { Jellyfin={ icon = "jellyfin.png"; href = "https://${serverCfg.containers.jellyfin.subdomain}.${serverCfg.domain}"; }; }) (lib.optional (serverCfg.containers?invidious) { Invidious={ icon = "invidious.png"; href = "https://${serverCfg.containers.invidious.subdomain}.${serverCfg.domain}"; }; }) ];} {Dev = lib.flatten [ (lib.optional (serverCfg.containers?gitea) { Gitea={ icon = "gitea.png"; href = "https://${serverCfg.containers.gitea.subdomain}.${serverCfg.domain}"; }; }) ];} # cloud = [] # ++ (if (serverCfg.containers?nextcloud) then [{ # icon = "nextcloud.png"; # href = "https://${serverCfg.containers.nextcloud.subdomain}.${serverCfg.domain}"; # }] else []); ]; in { sops = false; db = false; containers = { server = builder.mkContainer { subdomain = containerCfg.subdomain; image = "ghcr.io/gethomepage/homepage:${version}"; port = 3000; extraEnv = { HOMEPAGE_VAR_TITLE="${serverCfg.domain}"; HOMEPAGE_ALLOWED_HOSTS = "${containerCfg.subdomain}.${serverCfg.domain},${builder.host}"; }; extraLabels = { "traefik.http.routers.${containerCfg.subdomain}.service" = "${containerCfg.subdomain}"; }; overrides = { volumes = [ "${settings}:/app/config/settings.yaml:ro" "${services}:/app/config/services.yaml:ro" ]; }; }; }; }