mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 19:51:34 +01:00
Credit to https://lorenzbischof.ch/posts/detect-port-conflicts-in-nixos-services/
31 lines
628 B
Nix
31 lines
628 B
Nix
{ config, lib, ... }:
|
|
let
|
|
cfg = config.custom.services.ntfy;
|
|
in
|
|
{
|
|
options.custom.services.ntfy = {
|
|
enable = lib.mkEnableOption "";
|
|
domain = lib.mkOption {
|
|
type = lib.types.nonEmptyStr;
|
|
default = "";
|
|
};
|
|
port = lib.mkOption {
|
|
type = lib.types.port;
|
|
default = 2586;
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
meta.ports.list = [ cfg.port ];
|
|
|
|
services.ntfy-sh = {
|
|
enable = true;
|
|
settings = {
|
|
base-url = "https://${cfg.domain}";
|
|
listen-http = ":${toString cfg.port}";
|
|
behind-proxy = true;
|
|
web-root = "disable";
|
|
};
|
|
};
|
|
};
|
|
}
|