openspeedtest: Init module

This commit is contained in:
SebastianStork 2025-08-24 17:45:54 +02:00
parent 3cbec59b6d
commit af9fd8b2c7

View file

@ -0,0 +1,30 @@
{ config, lib, ... }:
let
cfg = config.custom.services.openspeedtest;
in
{
options.custom.services.openspeedtest = {
enable = lib.mkEnableOption "";
domain = lib.mkOption {
type = lib.types.nonEmptyStr;
default = "";
};
port = lib.mkOption {
type = lib.types.port;
default = 3001;
};
};
config = lib.mkIf cfg.enable {
meta = {
domains.list = [ cfg.domain ];
ports.list = [ cfg.port ];
};
virtualisation.oci-containers.containers.openspeedtest = {
image = "openspeedtest/latest";
ports = [ "${builtins.toString cfg.port}:3000" ];
pull = "newer";
};
};
}