From 9b8ced6e698f3cd5d92882bd7e10e7ddbbe7d19e Mon Sep 17 00:00:00 2001 From: Niklas Korz Date: Wed, 21 May 2025 10:27:36 +0200 Subject: [PATCH 1/2] meilisearch_1_11: init at 1.11.3 --- pkgs/by-name/me/meilisearch/package.nix | 20 +++++++++++++++++--- pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/me/meilisearch/package.nix b/pkgs/by-name/me/meilisearch/package.nix index 7336f922581b..20849417bd41 100644 --- a/pkgs/by-name/me/meilisearch/package.nix +++ b/pkgs/by-name/me/meilisearch/package.nix @@ -4,10 +4,24 @@ fetchFromGitHub, nixosTests, nix-update-script, + version ? "1.14.0", }: let - version = "1.14.0"; + # Version 1.11 is kept here as it was the last version not to support dumpless + # upgrades, meaning NixOS systems that have set up their data before 25.05 + # would not be able to update to 1.12+ without manual data migration. + # We're planning to remove it towards NixOS 25.11. Make sure to update + # the meilisearch module accordingly and to remove the meilisearch_1_11 + # attribute from all-packages.nix at that point too. + hashes = { + "1.14.0" = "sha256-nPOhiJJbZCr9PBlR6bsZ9trSn/2XCI2O+nXeYbZEQpU="; + "1.11.3" = "sha256-CVofke9tOGeDEhRHEt6EYwT52eeAYNqlEd9zPpmXQ2U="; + }; + cargoHashes = { + "1.14.0" = "sha256-8fcOXAzheG9xm1v7uD3T+6oc/dD4cjtu3zzBBh2EkcE="; + "1.11.3" = "sha256-cEJTokDJQuc9Le5+3ObMDNJmEhWEb+Qh0TV9xZkD9D8="; + }; in rustPlatform.buildRustPackage { pname = "meilisearch"; @@ -17,13 +31,13 @@ rustPlatform.buildRustPackage { owner = "meilisearch"; repo = "meiliSearch"; tag = "v${version}"; - hash = "sha256-nPOhiJJbZCr9PBlR6bsZ9trSn/2XCI2O+nXeYbZEQpU="; + hash = hashes.${version}; }; cargoBuildFlags = [ "--package=meilisearch" ]; useFetchCargoVendor = true; - cargoHash = "sha256-8fcOXAzheG9xm1v7uD3T+6oc/dD4cjtu3zzBBh2EkcE="; + cargoHash = cargoHashes.${version}; # Default features include mini dashboard which downloads something from the internet. buildNoDefaultFeatures = true; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 12e622afedf0..08e590200c1a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16284,6 +16284,8 @@ with pkgs; icu = icu71; }; + meilisearch_1_11 = callPackage ../by-name/me/meilisearch/package.nix { version = "1.11.3"; }; + mongocxx = callPackage ../development/libraries/mongocxx/default.nix { }; muse = libsForQt5.callPackage ../applications/audio/muse { }; From aac2e41ce04c2dfab59497a741d34ab6994e9512 Mon Sep 17 00:00:00 2001 From: Niklas Korz Date: Wed, 21 May 2025 10:42:05 +0200 Subject: [PATCH 2/2] nixos/meilisearch: use meilisearch_1_11 for stateVersion below 25.05 --- nixos/modules/services/search/meilisearch.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nixos/modules/services/search/meilisearch.nix b/nixos/modules/services/search/meilisearch.nix index 03b581c4d8cd..0194a658c0d3 100644 --- a/nixos/modules/services/search/meilisearch.nix +++ b/nixos/modules/services/search/meilisearch.nix @@ -129,6 +129,22 @@ in config = lib.mkIf cfg.enable { + warnings = lib.optional (lib.versionOlder cfg.package.version "1.12") '' + Meilisearch 1.11 will be removed in NixOS 25.11. As it was the last + version not to support dumpless upgrades, you will have to manually + migrate your data before that. Instructions can be found at + https://www.meilisearch.com/docs/learn/update_and_migration/updating#using-a-dump + and afterwards, you can set `services.meilisearch.package = pkgs.meilisearch;` + to use the latest version. + ''; + + services.meilisearch.package = lib.mkDefault ( + if lib.versionAtLeast config.system.stateVersion "25.05" then + pkgs.meilisearch + else + pkgs.meilisearch_1_11 + ); + # used to restore dumps environment.systemPackages = [ cfg.package ];