From 431ccf26e49eb66d0c229a0dd14d5b8f0f00f455 Mon Sep 17 00:00:00 2001 From: Kerstin Humm Date: Thu, 6 Apr 2023 16:12:51 +0200 Subject: [PATCH] nixos/mastodon: add assertion for only allowing one sidekiq scheduler queue --- nixos/modules/services/web-apps/mastodon.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nixos/modules/services/web-apps/mastodon.nix b/nixos/modules/services/web-apps/mastodon.nix index 1b6e1ac583af..73a9a664c090 100644 --- a/nixos/modules/services/web-apps/mastodon.nix +++ b/nixos/modules/services/web-apps/mastodon.nix @@ -513,6 +513,13 @@ in { is enabled. ''; } + { + assertion = 1 == builtins.length + (lib.mapAttrsToList + (_: v: builtins.elem "scheduler" v.jobClasses || v.jobClasses == [ ]) + cfg.sidekiqProcesses); + message = "There must be one and only one Sidekiq queue in services.mastodon.sidekiqProcesses with jobClass \"scheduler\"."; + } ]; environment.systemPackages = [ mastodonTootctl ];