refactor: unify evalClanService with evalService

This commit is contained in:
Johannes Kirschbauer
2025-06-26 14:50:35 +02:00
parent 1568950410
commit 11a94893fb
13 changed files with 97 additions and 101 deletions

View File

@@ -0,0 +1,30 @@
/*
Example usage:
```nix
evalService = import /this/file.nix { inherit lib clanLib; };
result = evalService { modules = []; prefix = []; };
=> result.config
=> result.options
```
*/
{ lib, clanLib }:
# <lambda evalService>
{ modules, prefix }:
lib.evalModules {
class = "clan.service";
specialArgs._ctx = prefix;
modules =
[
# Base module
./service-module.nix
# Feature modules
(lib.modules.importApply ./api-feature.nix {
inherit clanLib prefix;
})
]
++
# Modules of caller
modules;
}