11 rustPlatform.buildRustPackage rec {
12 pname = "sonic-server";
15 src = fetchFromGitHub {
16 owner = "valeriansaliou";
18 rev = "refs/tags/v${version}";
19 hash = "sha256-PTujR3ciLRvbpiqStNMx3W5fkUdW2dsGmCj/iFRTKJM=";
22 cargoHash = "sha256-bH9u38gvH6QEySQ3XFXEHBiSqKKtB+kjcZRLjx4Z6XM=";
24 # Found argument '--test-threads' which wasn't expected, or isn't valid in this context
28 rustPlatform.bindgenHook
31 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-faligned-allocation";
34 substituteInPlace src/main.rs --replace "./config.cfg" "$out/etc/sonic/config.cfg"
38 install -Dm444 -t $out/etc/sonic config.cfg
39 install -Dm444 -t $out/lib/systemd/system debian/sonic.service
42 $out/lib/systemd/system/sonic.service \
43 --replace /usr/bin/sonic $out/bin/sonic \
44 --replace /etc/sonic.cfg $out/etc/sonic/config.cfg
49 inherit (nixosTests) sonic-server;
50 version = testers.testVersion {
51 command = "sonic --version";
52 package = sonic-server;
55 updateScript = nix-update-script { };
59 description = "Fast, lightweight and schema-less search backend";
60 homepage = "https://github.com/valeriansaliou/sonic";
61 changelog = "https://github.com/valeriansaliou/sonic/releases/tag/v${version}";
62 license = licenses.mpl20;
63 platforms = platforms.unix;
64 mainProgram = "sonic";
65 maintainers = with maintainers; [ pleshevskiy anthonyroussel ];