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 ]; 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 c2074113a8ce..82f90e13de10 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16280,6 +16280,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 { };