Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 73 lines 2.1 kB view raw
1{ 2 lib, 3 rustPlatform, 4 fetchFromGitHub, 5 nixosTests, 6 nix-update-script, 7 version ? "1.15.2", 8}: 9 10let 11 # Version 1.11 is kept here as it was the last version not to support dumpless 12 # upgrades, meaning NixOS systems that have set up their data before 25.05 13 # would not be able to update to 1.12+ without manual data migration. 14 # We're planning to remove it towards NixOS 25.11. Make sure to update 15 # the meilisearch module accordingly and to remove the meilisearch_1_11 16 # attribute from all-packages.nix at that point too. 17 hashes = { 18 "1.15.2" = "sha256-aTgfgPuyRcjr/DxxyuKOFXfBcDponVmKz5PpGbnsmd0="; 19 "1.11.3" = "sha256-CVofke9tOGeDEhRHEt6EYwT52eeAYNqlEd9zPpmXQ2U="; 20 }; 21 cargoHashes = { 22 "1.15.2" = "sha256-eBGxVtE25txA17zxXdlSC6Vbrm+/v1fA7iTIBDvQ71M="; 23 "1.11.3" = "sha256-cEJTokDJQuc9Le5+3ObMDNJmEhWEb+Qh0TV9xZkD9D8="; 24 }; 25in 26rustPlatform.buildRustPackage { 27 pname = "meilisearch"; 28 inherit version; 29 30 src = fetchFromGitHub { 31 owner = "meilisearch"; 32 repo = "meiliSearch"; 33 tag = "v${version}"; 34 hash = hashes.${version}; 35 }; 36 37 cargoBuildFlags = [ "--package=meilisearch" ]; 38 39 cargoHash = cargoHashes.${version}; 40 41 # Default features include mini dashboard which downloads something from the internet. 42 buildNoDefaultFeatures = true; 43 44 nativeBuildInputs = [ rustPlatform.bindgenHook ]; 45 46 passthru = { 47 updateScript = nix-update-script { }; 48 tests = { 49 meilisearch = nixosTests.meilisearch; 50 }; 51 }; 52 53 # Tests will try to compile with mini-dashboard features which downloads something from the internet. 54 doCheck = false; 55 56 meta = { 57 description = "Powerful, fast, and an easy to use search engine"; 58 mainProgram = "meilisearch"; 59 homepage = "https://docs.meilisearch.com/"; 60 changelog = "https://github.com/meilisearch/meilisearch/releases/tag/v${version}"; 61 license = lib.licenses.mit; 62 maintainers = with lib.maintainers; [ 63 happysalada 64 bbenno 65 ]; 66 platforms = [ 67 "aarch64-linux" 68 "aarch64-darwin" 69 "x86_64-linux" 70 "x86_64-darwin" 71 ]; 72 }; 73}