37 lines
915 B
Nix
37 lines
915 B
Nix
{
|
|
config,
|
|
lib,
|
|
inputs,
|
|
pkgs,
|
|
...
|
|
}: let
|
|
serviceName = "azion-scheduler";
|
|
proxyServiceName = "${serviceName}-proxy";
|
|
servicePort = config.m3ta.ports.get serviceName;
|
|
schedulerProxyPort = config.m3ta.ports.get proxyServiceName;
|
|
in {
|
|
services.azion-scheduler = {
|
|
enable = true;
|
|
package = inputs.azion-scheduler.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
|
port = servicePort;
|
|
proxyPort = schedulerProxyPort;
|
|
environmentFile = config.age.secrets.azion-env.path;
|
|
};
|
|
|
|
# Traefik configuration
|
|
services.traefik.dynamicConfigOptions.http = {
|
|
services.${serviceName}.loadBalancer.servers = [
|
|
{url = "http://localhost:${toString servicePort}/";}
|
|
];
|
|
|
|
routers.${serviceName} = {
|
|
rule = "Host(`azion.l.az-gruppe.com`)";
|
|
tls = {
|
|
certResolver = "ionos";
|
|
};
|
|
service = serviceName;
|
|
entrypoints = "websecure";
|
|
};
|
|
};
|
|
}
|