services-flake/README.md

50 lines
1.7 KiB
Markdown
Raw Normal View History

2023-06-20 00:44:27 +03:00
# services-flake
2023-06-27 17:46:41 +03:00
> **Note**
>
> 🚧 Work in Progress
NixOS-like services for Nix flakes, as a [process-compose-flake](https://github.com/Platonic-Systems/process-compose-flake) module (based on flake-parts).
2023-07-18 17:49:07 +03:00
![](./doc/demo.gif)
2023-07-10 20:18:46 +03:00
## Getting Started
2023-11-21 23:36:01 +03:00
```sh
$ nix flake new --template github:juspay/services-flake ./my-project
$ cd my-project
$ nix run
```
2023-11-21 23:36:01 +03:00
Or see `./test/flake.nix`
2023-06-20 01:01:04 +03:00
## Services available
- [x] Apache Kafka
- [x] Elasticsearch
2023-09-07 18:06:27 +03:00
- [x] MySQL
- [x] PostgreSQL
2023-07-10 18:14:26 +03:00
- [x] Redis
2023-08-02 07:28:19 +03:00
- [x] Redis Cluster
- [x] Zookeeper
- [ ] ...
## A note on process working directory
2023-11-17 23:08:15 +03:00
The `dataDir` of these services tend to take *relative* paths, which are usually relative to the project root. As such, when you run these services using `nix run`, their data files are created relative to whichever directory you are in. If you want these data files to always reside relative to the project directory, instead of using `nix run` consider wrapping the process-compose packages in script, via either [mission-control](https://flakular.in/mission-control/) module or a [justfile](https://just.systems/). The example uses the latter.
## Contributing
2023-06-20 01:02:41 +03:00
- If you are adding a *new* service, see https://github.com/cachix/devenv/tree/main/src/modules/services for inspiration.
2023-11-17 23:08:15 +03:00
- For contributing to docs, see https://flakular.in/about#contributing
## Credits
2023-06-21 17:00:29 +03:00
Thanks to [the devenv project](https://github.com/cachix/devenv/tree/main/src/modules/services) on which much of our services implementation is based on.
2023-06-27 03:56:27 +03:00
## FAQ
### Why not re-use devenv service modules?
This is currently not possible (nor prioritized by the devenv project), which is why we must create our own services. See https://github.com/cachix/devenv/issues/75