From 37d3de9a86f347ce8837bc5d6074136f42e3e0f3 Mon Sep 17 00:00:00 2001 From: magicquark <198001825+magicquark@users.noreply.github.com> Date: Sun, 12 Jul 2026 17:01:11 +0100 Subject: [PATCH] nixos/linkding: add options to configure processes and thread counts Presently, the number of threads and processes the service uses is fixed to 2 and 2, respectively. [Upstream](https://github.com/sissbruecker/linkding/issues/420) recommends using a custom `uwsgi.ini` to configure these parameters. Thus, add the `processes` and `threads` configuration options to allow this to be configured in the NixOS module. --- nixos/modules/services/web-apps/linkding.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/web-apps/linkding.nix b/nixos/modules/services/web-apps/linkding.nix index fae7fb89c4d9..817a1bd7920d 100644 --- a/nixos/modules/services/web-apps/linkding.nix +++ b/nixos/modules/services/web-apps/linkding.nix @@ -151,6 +151,18 @@ in default = false; description = "Open the linkding port in the firewall."; }; + + processes = mkOption { + type = types.ints.positive; + default = 2; + description = "Number of uWSGI processes to spawn."; + }; + + threads = mkOption { + type = types.ints.positive; + default = 2; + description = "Number of threads to spawn (per uWSGI process)."; + }; }; config = mkIf cfg.enable ( @@ -196,8 +208,8 @@ in plugin = python3 module = bookmarks.wsgi:application env = DJANGO_SETTINGS_MODULE=bookmarks.settings.prod - processes = 2 - threads = 2 + processes = ${toString cfg.processes} + threads = ${toString cfg.threads} buffer-size = 8192 die-on-term = true mime-file = ${pkgs.mailcap}/etc/mime.types