12 rustPlatform.buildRustPackage rec {
13 pname = "sonic-server";
16 src = fetchFromGitHub {
17 owner = "valeriansaliou";
19 rev = "refs/tags/v${version}";
20 hash = "sha256-PTujR3ciLRvbpiqStNMx3W5fkUdW2dsGmCj/iFRTKJM=";
23 cargoHash = "sha256-bH9u38gvH6QEySQ3XFXEHBiSqKKtB+kjcZRLjx4Z6XM=";
26 rustPlatform.bindgenHook
29 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-faligned-allocation";
32 substituteInPlace src/main.rs \
33 --replace-fail "./config.cfg" "$out/etc/sonic/config.cfg"
37 install -Dm444 -t $out/etc/sonic config.cfg
38 install -Dm444 -t $out/lib/systemd/system debian/sonic.service
40 substituteInPlace $out/lib/systemd/system/sonic.service \
41 --replace-fail /usr/bin/sonic $out/bin/sonic \
42 --replace-fail /etc/sonic.cfg $out/etc/sonic/config.cfg
45 # Found argument '--test-threads' which wasn't expected, or isn't valid in this context
50 inherit (nixosTests) sonic-server;
51 version = testers.testVersion {
52 command = "sonic --version";
53 package = sonic-server;
56 updateScript = nix-update-script { };
60 description = "Fast, lightweight and schema-less search backend";
61 homepage = "https://github.com/valeriansaliou/sonic";
62 changelog = "https://github.com/valeriansaliou/sonic/releases/tag/v${version}";
63 license = licenses.mpl20;
64 platforms = platforms.unix;
65 mainProgram = "sonic";
66 maintainers = with maintainers; [