2021-09-18 10:52:07 +00:00
|
|
|
{ pkgs
|
|
|
|
, lib
|
|
|
|
, stdenv
|
|
|
|
, buildRustCrate
|
|
|
|
, defaultCrateOverrides
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, Security
|
2021-09-18 10:52:07 +00:00
|
|
|
, features ? [ ]
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
let
|
|
|
|
version = "0.21.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "meilisearch";
|
|
|
|
repo = "MeiliSearch";
|
|
|
|
rev = "v${version}";
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "sha256-wyyhTNhVw8EJhahstLK+QuEhufQC68rMpw/ngK8FL8Y=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-09-18 10:52:07 +00:00
|
|
|
customBuildRustCrateForPkgs = pkgs: buildRustCrate.override {
|
|
|
|
defaultCrateOverrides = defaultCrateOverrides // {
|
|
|
|
meilisearch-http = attrs: {
|
|
|
|
src = "${src}/meilisearch-http";
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ Security ];
|
|
|
|
};
|
|
|
|
meilisearch-error = attrs: {
|
|
|
|
src = "${src}/meilisearch-error";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
cargo_nix = import ./Cargo.nix {
|
|
|
|
inherit pkgs;
|
|
|
|
buildRustCrateForPkgs = customBuildRustCrateForPkgs;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-09-18 10:52:07 +00:00
|
|
|
meilisearch-http = cargo_nix.workspaceMembers."meilisearch-http".build.override {
|
|
|
|
inherit features;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "meilisearch";
|
|
|
|
inherit version src;
|
|
|
|
dontUnpack = true;
|
|
|
|
dontBuild = true;
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp ${meilisearch-http}/bin/meilisearch $out/bin/meilisearch
|
|
|
|
'';
|
|
|
|
dontCheck = true;
|
|
|
|
dontFixup = true;
|
2021-09-26 12:46:18 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Powerful, fast, and an easy to use search engine ";
|
|
|
|
homepage = https://docs.meilisearch.com/;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ happysalada ];
|
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|