Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

70 lines
1.7 KiB
Nix
Raw Permalink Normal View History

{
lib,
stdenv,
fetchFromGitHub,
nix-update-script,
nixosTests,
rustPlatform,
sonic-server,
testers,
2022-10-20 17:21:43 +03:00
}:
rustPlatform.buildRustPackage rec {
2022-10-20 17:21:43 +03:00
pname = "sonic-server";
2024-06-17 09:24:06 +00:00
version = "1.4.9";
2022-10-20 17:21:43 +03:00
src = fetchFromGitHub {
owner = "valeriansaliou";
repo = "sonic";
tag = "v${version}";
2024-06-17 09:24:06 +00:00
hash = "sha256-PTujR3ciLRvbpiqStNMx3W5fkUdW2dsGmCj/iFRTKJM=";
2022-10-20 17:21:43 +03:00
};
cargoHash = "sha256-RO4wY7FMwczZeR4GOxA3mwfBJZKPToOJJKGZb48yHJA=";
2022-10-20 17:21:43 +03:00
nativeBuildInputs = [
2023-05-27 02:56:05 +03:00
rustPlatform.bindgenHook
2022-10-20 17:21:43 +03:00
];
postPatch = ''
substituteInPlace src/main.rs \
--replace-fail "./config.cfg" "$out/etc/sonic/config.cfg"
2022-10-20 17:21:43 +03:00
'';
postInstall = ''
install -Dm444 -t $out/etc/sonic config.cfg
install -Dm444 -t $out/lib/systemd/system debian/sonic.service
substituteInPlace $out/lib/systemd/system/sonic.service \
--replace-fail /usr/bin/sonic $out/bin/sonic \
--replace-fail /etc/sonic.cfg $out/etc/sonic/config.cfg
2022-10-20 17:21:43 +03:00
'';
# Found argument '--test-threads' which wasn't expected, or isn't valid in this context
doCheck = false;
passthru = {
tests = {
inherit (nixosTests) sonic-server;
version = testers.testVersion {
command = "sonic --version";
package = sonic-server;
};
};
updateScript = nix-update-script { };
};
2025-06-06 21:58:04 +02:00
meta = {
2022-10-20 17:21:43 +03:00
description = "Fast, lightweight and schema-less search backend";
homepage = "https://github.com/valeriansaliou/sonic";
changelog = "https://github.com/valeriansaliou/sonic/releases/tag/v${version}";
2025-06-06 21:58:04 +02:00
license = lib.licenses.mpl20;
platforms = lib.platforms.unix;
mainProgram = "sonic";
2025-06-06 21:58:04 +02:00
maintainers = with lib.maintainers; [
pleshevskiy
anthonyroussel
];
2022-10-20 17:21:43 +03:00
};
}