Files
aloslider c92b90e406 Small modules config restructure
Changed variables names in every module
2026-10-31 19:48:50 +03:00

45 lines
1.1 KiB
Nix

{ config, lib, ... }:
with lib;
let
rootCfg = config.selfhosted;
common = rootCfg.common;
moduleCfg = rootCfg.mihomo;
cfg = moduleCfg.dashboard;
in
{
options.selfhosted.mihomo.dashboard = {
name = mkOption {
type = types.str;
};
subdomain = mkOption {
type = types.str;
};
hostHttpPort = mkOption {
type = types.port;
};
};
config = mkIf moduleCfg.enable {
virtualisation.oci-containers.containers.${cfg.name} = {
image = "ghcr.io/zephyruso/zashboard:v3.19.0";
ports = [
"0.0.0.0:${toString cfg.hostHttpPort}:80"
];
log-driver = "journald";
extraOptions = [
"--network=${common.network.name}"
];
};
systemd.services."${common.backend}-${cfg.name}" = {
serviceConfig = {
Restart = lib.mkOverride 90 "always";
};
wantedBy = [ "${common.backend}-${moduleCfg.targetName}.target" ];
partOf = [ "${common.backend}-${moduleCfg.targetName}.target" ];
requires = [ "${common.backend}-${moduleCfg.core.name}.service" ];
after = [ "${common.backend}-${moduleCfg.core.name}.service" ];
};
};
}