27 lines
802 B
Nix
27 lines
802 B
Nix
{ config, lib, ... }:
|
|
|
|
let
|
|
cfg = config.homelab.apps.speedtest;
|
|
in {
|
|
options.homelab.apps.speedtest.enable = lib.mkEnableOption "Speedtest";
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
homelab.virtualisation.containers.enable = true;
|
|
|
|
virtualisation.oci-containers.containers.speedtest = {
|
|
hostname = "speedtest";
|
|
image = "openspeedtest/latest:v2.0.5";
|
|
ports = [
|
|
"3000:3000"
|
|
"3001:3001"
|
|
];
|
|
labels = {
|
|
"traefik.enable" = "true";
|
|
"traefik.http.routers.speedtest.rule" = "Host(`speedtest.${config.networking.hostName}.${config.networking.domain}`)";
|
|
"traefik.http.services.speedtest.loadbalancer.server.port" = "9090";
|
|
"traefik.tls.options.default.minVersion" = "VersionTLS13";
|
|
};
|
|
autoStart = true;
|
|
};
|
|
};
|
|
}
|