mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31:34 +01:00
openspeedtest: Init module
This commit is contained in:
parent
3cbec59b6d
commit
af9fd8b2c7
1 changed files with 30 additions and 0 deletions
30
modules/system/services/openspeedtest.nix
Normal file
30
modules/system/services/openspeedtest.nix
Normal 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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue