From 672f423d0c0285db48b9da5459a0f2eaf5b2e24f Mon Sep 17 00:00:00 2001 From: Morgan Jones Date: Sat, 25 Jan 2025 17:43:18 -0800 Subject: [PATCH] nixos/mattermost: default preferNixConfig to true Now that we are disabling telemetry by default, we should attempt to override it and other options in existing mutable configs, if the user had a mutable config and advances their system.stateVersion. --- nixos/modules/services/web-apps/mattermost.nix | 5 ++++- nixos/tests/mattermost/default.nix | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/web-apps/mattermost.nix b/nixos/modules/services/web-apps/mattermost.nix index e21164e1e74c..56799a744806 100644 --- a/nixos/modules/services/web-apps/mattermost.nix +++ b/nixos/modules/services/web-apps/mattermost.nix @@ -462,7 +462,10 @@ in preferNixConfig = mkOption { type = types.bool; - default = false; + default = versionAtLeast config.system.stateVersion "25.05"; + defaultText = '' + versionAtLeast config.system.stateVersion "25.05"; + ''; description = '' If both mutableConfig and this option are set, the Nix configuration will take precedence over any settings configured in the server diff --git a/nixos/tests/mattermost/default.nix b/nixos/tests/mattermost/default.nix index 02f5e8ce247b..eb7b814e3983 100644 --- a/nixos/tests/mattermost/default.nix +++ b/nixos/tests/mattermost/default.nix @@ -94,6 +94,7 @@ import ../make-test-python.nix ( makeMattermost { mutableConfig = true; + preferNixConfig = false; settings.SupportSettings.HelpLink = "https://search.nixos.org"; } { @@ -105,7 +106,6 @@ import ../make-test-python.nix ( }; postgresMostlyMutable = makeMattermost { mutableConfig = true; - preferNixConfig = true; plugins = with pkgs; [ # Build the demo plugin. (mattermost.buildPlugin {