MyNixOS website logo
option

services.librespeed.settings

LibreSpeed configuration written as Nix expression. All values set to null will be excluded from the evaluated config. This is useful if you want to omit certain defaults when using a different LibreSpeed implementation.

See github.com/librespeed for configuration help.

Declarations
Type
null or (attribute set of (null or boolean or signed integer or string or package))
Default
{
  assets_path = if (config.services.librespeed.frontend.enable && !config.services.librespeed.frontend.useNginx) then
    librespeedAssets
  else
    pkgs.writeTextDir "index.html" "";

  bind_address = "::";
  listen_port = 8989;
  base_url = "backend";
  worker_threads = "auto";

  database_type = "none";
  database_file = "/var/lib/librespeed/speedtest.sqlite";

  # librespeed-rust will fail to start if the following config parameters are omitted.
  ipinfo_api_key = "";
  stats_password = "";

  redact_ip_addresses = false;
  result_image_theme = "light";

  enable_tls = config.services.librespeed.tlsCertificate != null && config.services.librespeed.tlsKey != null;
  tls_cert_file = lib.optionalString (config.services.librespeed.tlsCertificate != null) "/run/credentials/librespeed.service/cert.pem";
  tls_key_file = lib.optionalString (config.services.librespeed.tlsKey != null) "/run/credentials/librespeed.service/key.pem";
}