about summary refs log tree commit diff
path: root/nixos/modules/services/web-apps/mastodon.nix
diff options
context:
space:
mode:
authorKerstin Humm <kerstin@erictapen.name>2023-04-20 22:57:03 +0200
committerKerstin Humm <kerstin@erictapen.name>2023-04-20 22:58:34 +0200
commitaff288424f58905da60931ad86a50a03c7552af3 (patch)
treed28e795181f3d03dc338df94aa9783777a4bc398 /nixos/modules/services/web-apps/mastodon.nix
parent555daa9d339b3df75e58ee558a4fec98ea92521e (diff)
nixos/mastodon: fixup sidekiq jobClasses assertion
See https://github.com/NixOS/nixpkgs/pull/225005#issuecomment-1516677321
Diffstat (limited to 'nixos/modules/services/web-apps/mastodon.nix')
-rw-r--r--nixos/modules/services/web-apps/mastodon.nix11
1 files changed, 6 insertions, 5 deletions
diff --git a/nixos/modules/services/web-apps/mastodon.nix b/nixos/modules/services/web-apps/mastodon.nix
index cf5329be489c1..247eb707b15c6 100644
--- a/nixos/modules/services/web-apps/mastodon.nix
+++ b/nixos/modules/services/web-apps/mastodon.nix
@@ -588,11 +588,12 @@ in {
         '';
       }
       {
-        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\".";
+        assertion = 1 ==
+          (lib.count (x: x)
+            (lib.mapAttrsToList
+              (_: v: builtins.elem "scheduler" v.jobClasses || v.jobClasses == [ ])
+              cfg.sidekiqProcesses));
+        message = "There must be exactly one Sidekiq queue in services.mastodon.sidekiqProcesses with jobClass \"scheduler\".";
       }
     ];