Files
nixconfig/modules/server/containers/apps/homepage.nix
soraefir a3c14208c3 fix
2026-05-30 23:33:23 +02:00

66 lines
2.0 KiB
Nix

{ 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.optionalAttrs (serverCfg.containers?jellyfin) {
"Jellyfin"={
icon = "jellyfin.png";
href = "https://${serverCfg.containers.jellyfin.subdomain}.${serverCfg.domain}";
};
}
];}
{Dev = [{
} // lib.optionalAttrs (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"
];
};
};
};
}