diff --git a/package/tubesync/nixos.nix b/package/tubesync/nixos.nix index e4552f4b..53628cf2 100644 --- a/package/tubesync/nixos.nix +++ b/package/tubesync/nixos.nix @@ -13,6 +13,12 @@ in { description = "tubesync launcher package"; }; + workers = mkOption { + type = with types; int; + default = 1; + description = "maximum amount of concurrent workers"; + }; + user = mkOption { type = with types; str; default = "tubesync"; @@ -59,7 +65,6 @@ in { config = mkIf cfg.enable { systemd.services = let env = { - PYTHONPATH = cfg.package.pythonPath; GUNICORN_PID_FILE = "${cfg.stateDir}/run/gunicorn.pid"; GUNICORN_USER = cfg.user; GUNICORN_GROUP = cfg.group; @@ -67,7 +72,9 @@ in { CONFIG_BASE_DIR = cfg.stateDir; DOWNLOADS_BASE_DIR = cfg.dataDir; TUBESYNC_DEBUG = mkIf cfg.debug "True"; + TUBESYNC_WORKERS = toString cfg.workers; + PYTHONPATH = cfg.package.pythonPath; REDIS_CONNECTION = "redis+socket://" + "${cfg.stateDir}/run/redis.sock"; };