juspay / juspay/services-flake

multiService: Add `depends_on` as a default option

Open
#616 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Nix
Stars
768
Forks
69
Avg merge
7d 20h
Merged PRs (30d)
5

Description

`multiService` defines a few [options defaults](https://github.com/juspay/services-flake/blob/4104b44868206c7fd7738e349d814a352c480711/nix/lib.nix#L18-L30) like `enable`, `namespace` and `dataDir`, which can reasonably expected to be defined by all the services.

I propose to also include `depends_on` here.

## Why?

- Often we end up splitting `depends_on` config for a service away from the service config, see

```nix
{
open-webui."open-webui1" = {
enable = true;

};

# Start the Open WebUI service after the Ollama service has finished initializing and loading the models
settings.processes.open-webui1.depends_on.ollama1-models.condition = "process_completed_successfully";
}
```
[(code snippet from example/llm)](https://github.com/juspay/services-flake/blob/4104b44868206c7fd7738e349d814a352c480711/example/llm/flake.nix#L49-L75)

If this proposal is implemented, it can be changed to:
```nix
{
open-webui."open-webui1" = {
enable = true;
depends_on.ollama1-models.condition = "process_completed_successfully";

};
}
```

- `depends_on` is an option almost always used while defining complex service dependency relationship.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.