valeriansaliou / sonic

🦔 Fast, lightweight & schema-less search backend. An alternative to Elasticsearch that runs on a few MBs of RAM.
https://crates.io/crates/sonic-server
Mozilla Public License 2.0
20.11k stars 578 forks source link

Add basic nix flake #296

Closed pleshevskiy closed 2 years ago

pleshevskiy commented 2 years ago

I have added a basic flake.nix configuration for nix users, as well as CI for tests of functionality.

This will help me use the latest sonic-server and add new functionality to sonic-channel.

And in the future I would like to add a nixos module, since I am transferring the whole my infrastructure to this operating system)

valeriansaliou commented 2 years ago

Hello. Thank you for this PR. While this is useful to a certain subset of Sonic users, I think those files are too specific to be placed in the main Sonic repository. I'd suggest that you'd rather create eg. a sonic-nix-tools repository on your end. The same would go for eg. Kubernetes HELM chart files, as this was the case for another PR.

Sorry for that, this is just me trying to keep things minimal :)

pleshevskiy commented 2 years ago

Well you support Dockerfile :) nix is just one way to use sonic-server.

With these changes, anyone with nix package manager installed can run the server this way:

nix run github:valeriansaliou/sonic -- -c sonic.cfg

For developers who are sitting on nix this is just as handy to contribute to sonic with the nix develop command.

Adding another repository does not make sense since there is already a huge repository nixpkgs with a lot of packages, but flake gives you the option to install a specific one.

pleshevskiy commented 2 years ago

Nix is becoming more popular and many repositories are adding this, but if you don't mind, I will use my fork :)) just wanted to share with the community, since rocksdb is not so easy to compile)))

pleshevskiy commented 2 years ago

If anyone is interested, I have added instructions on how to use the nix flakes in my fork