{ lib, config, ... }: let cfg = config.my.servers.sabnzbd; in { options.my.servers.sabnzbd = { enable = lib.mkEnableOption "SABnzbd Usenet downloader"; port = lib.mkOption { type = lib.types.int; default = 3399; description = "The port to access sabnzbd web-ui"; }; }; config = lib.mkIf cfg.enable { my.network.firewall.additionalPorts = [ cfg.port ]; services.sabnzbd = { inherit (cfg) enable; group = "piracy"; }; }; }