docs: add motivation for creating services-flake (#125)

resolves #124 and #123

---------

Co-authored-by: Sridhar Ratnakumar <3998+srid@users.noreply.github.com>
This commit is contained in:
Shivaraj B H 2024-03-07 22:10:16 +05:30 committed by GitHub
parent 708ae40e62
commit 1ae2579853
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View File

@ -6,6 +6,15 @@ Declarative, composable, and reproducible services for Nix development environme
![Demo](./doc/demo.gif)
## Motivation
With `services-flake`, we aim to solve the following problems:
- Run external services like databases, Redis, etc. natively across platforms.
- Enable users to configure multiple instances of these external services.
- Provide project-specific service configuration and data isolation.
Consider a scenario where we are juggling two projects, located at `~/code/foo` and `~/code/bar`. The `foo` project integrates postgres and nginx, while `bar` encompasses postgres, pgAdmin, and kafka. It's crucial that the postgres data remains segregated across these projects. Additionally, the `bar` project is designed to facilitate multiple instances of postgres. Both projects are equipped with a flake app, streamlining the launch of their respective service stacks. Consequently, anyone using a Linux or macOS system can effortlessly clone either project and execute `nix run .#services` to activate the full suite of services without the need for manual configuration.
## Getting Started
See <https://community.flake.parts/services-flake/start>

View File

@ -58,3 +58,7 @@ nix run
[^how-default]: `default` is the name of the process group that is derived from `process-compose.<name>` in `perSystem.process-compose`.
[^sample-config]: See the example configuration from the [getting started](https://f1bonacc1.github.io/process-compose/intro/) section of the process-compose docs.
## Examples
- In [Nammayatri](https://github.com/nammayatri/nammayatri), services-flakes is used to run the local services stack (which used to be run with docker-compose). Read about it [in this blog post](https://nixos.asia/en/blog/replacing-docker-compose).