1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/servers/search/meilisearch/default.nix

50 lines
1.1 KiB
Nix
Raw Normal View History

2021-09-13 06:40:45 +01:00
{ pkgs
, lib
2021-09-02 06:34:47 +01:00
, stdenv
, buildRustCrate
, defaultCrateOverrides
2020-04-07 09:13:52 +01:00
, fetchFromGitHub
, Security
2021-09-02 06:34:47 +01:00
, features ? [ ]
2020-04-07 09:13:52 +01:00
}:
2021-09-02 06:34:47 +01:00
let
version = "0.21.1";
2020-04-07 09:13:52 +01:00
src = fetchFromGitHub {
owner = "meilisearch";
repo = "MeiliSearch";
rev = "v${version}";
2021-09-02 06:34:47 +01:00
sha256 = "sha256-wyyhTNhVw8EJhahstLK+QuEhufQC68rMpw/ngK8FL8Y=";
2020-04-07 09:13:52 +01:00
};
customBuildRustCrateForPkgs = pkgs: buildRustCrate.override {
2021-09-02 06:34:47 +01:00
defaultCrateOverrides = defaultCrateOverrides // {
meilisearch-http = attrs: {
src = "${src}/meilisearch-http";
buildInputs = lib.optionals stdenv.isDarwin [ Security ];
2021-09-02 06:34:47 +01:00
};
meilisearch-error = attrs: {
src = "${src}/meilisearch-error";
};
};
};
cargo_nix = import ./Cargo.nix {
2021-09-13 06:40:45 +01:00
inherit pkgs;
buildRustCrateForPkgs = customBuildRustCrateForPkgs;
};
meilisearch-http = cargo_nix.workspaceMembers."meilisearch-http".build.override {
inherit features;
2020-04-07 09:13:52 +01:00
};
2021-09-02 06:34:47 +01:00
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;
2020-04-07 09:13:52 +01:00
}