From ffcc12d1924df723e46719deec4fa175d953b5d0 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Tue, 8 Apr 2025 10:29:08 +0200 Subject: [PATCH] centrifugo: add release note and assertion for compatibility --- doc/release-notes/rl-2505.section.md | 2 ++ nixos/modules/services/networking/centrifugo.nix | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/doc/release-notes/rl-2505.section.md b/doc/release-notes/rl-2505.section.md index 6a6a797269c6..ddc57c62a89f 100644 --- a/doc/release-notes/rl-2505.section.md +++ b/doc/release-notes/rl-2505.section.md @@ -110,6 +110,8 @@ - `pkgs.nextcloud28` has been removed since it's out of support upstream. +- `centrifugo` was updated to v6, which uses a new config format. See [upstream documentation](https://centrifugal.dev/docs/getting-started/migration_v6) for migration. + - `teleport` has been upgraded from major version 16 to major version 17. Refer to [upstream upgrade instructions](https://goteleport.com/docs/upgrading/overview/) and [release notes for v17](https://goteleport.com/docs/changelog/#1701-11152024). diff --git a/nixos/modules/services/networking/centrifugo.nix b/nixos/modules/services/networking/centrifugo.nix index 7b9a05069498..0f2a9f3e5f6a 100644 --- a/nixos/modules/services/networking/centrifugo.nix +++ b/nixos/modules/services/networking/centrifugo.nix @@ -65,6 +65,14 @@ in }; config = lib.mkIf cfg.enable { + assertions = [ + { + assertion = + (lib.versionAtLeast cfg.package.version "6") -> (!(cfg.settings ? name) && !(cfg.settings ? port)); + message = "`services.centrifugo.settings` is v5 config, must be compatible with centrifugo v6 config format"; + } + ]; + systemd.services.centrifugo = { description = "Centrifugo messaging server"; wantedBy = [ "multi-user.target" ];