nixos: services: sabnzbd: add 'port' option

This commit is contained in:
Bruno BELANYI 2026-02-19 15:08:09 +01:00
parent f2ae223c66
commit c8f9e002f6

View file

@ -2,11 +2,17 @@
{ config, lib, ... }: { config, lib, ... }:
let let
cfg = config.my.services.sabnzbd; cfg = config.my.services.sabnzbd;
port = 9090; # NOTE: not declaratively set...
in in
{ {
options.my.services.sabnzbd = with lib; { options.my.services.sabnzbd = with lib; {
enable = mkEnableOption "SABnzbd binary news reader"; enable = mkEnableOption "SABnzbd binary news reader";
port = mkOption {
type = types.port;
default = 9090;
example = 4242;
description = "The port on which SABnzbd will listen for incoming HTTP traffic";
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@ -18,6 +24,13 @@ in
configFile = null; configFile = null;
# I want to configure servers outside of Nix # I want to configure servers outside of Nix
allowConfigWrite = true; allowConfigWrite = true;
settings = {
misc = {
host = "127.0.0.1";
inherit (cfg) port;
};
};
}; };
# Set-up media group # Set-up media group
@ -25,7 +38,7 @@ in
my.services.nginx.virtualHosts = { my.services.nginx.virtualHosts = {
sabnzbd = { sabnzbd = {
inherit port; inherit (cfg) port;
}; };
}; };