mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31:34 +01:00
Credit to https://lorenzbischof.ch/posts/detect-port-conflicts-in-nixos-services/
26 lines
507 B
Nix
26 lines
507 B
Nix
{ config, lib, ... }:
|
|
let
|
|
cfg = config.custom.services.uptimeKuma;
|
|
in
|
|
{
|
|
options.custom.services.uptimeKuma = {
|
|
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.ports.list = [ cfg.port ];
|
|
|
|
services.uptime-kuma = {
|
|
enable = true;
|
|
settings.PORT = toString cfg.port;
|
|
};
|
|
};
|
|
}
|