diff --git a/nixos/modules/services/misc/whisparr.nix b/nixos/modules/services/misc/whisparr.nix index bf15ee70fde440..833f9246745a8b 100644 --- a/nixos/modules/services/misc/whisparr.nix +++ b/nixos/modules/services/misc/whisparr.nix @@ -7,6 +7,7 @@ let cfg = config.services.whisparr; + servarr = import ./servarr/settings-options.nix { inherit lib pkgs; }; in { options = { @@ -27,6 +28,8 @@ in description = "Open ports in the firewall for the Whisparr web interface."; }; + settings = servarr.mkServarrSettingsOptions "whisparr" 6969; + user = lib.mkOption { type = lib.types.str; default = "whisparr"; @@ -48,6 +51,7 @@ in description = "Whisparr"; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; + environment = servarr.mkServarrSettingsEnvVars "WHISPARR" cfg.settings; serviceConfig = { Type = "simple"; @@ -58,7 +62,9 @@ in }; }; - networking.firewall = lib.mkIf cfg.openFirewall { allowedTCPPorts = [ 6969 ]; }; + networking.firewall = lib.mkIf cfg.openFirewall { + allowedTCPPorts = [ cfg.settings.server.port ]; + }; users.users = lib.mkIf (cfg.user == "whisparr") { whisparr = {