Modular, context-aware and aspect-oriented dendritic Nix configurations.
Discussions: https://oeiuwq.zulipchat.com/join/nqp26cd4kngon6mo3ncgnuap/
den.oeiuwq.com
configurations
den
dendritic
nix
aspect
oriented
1# for each host exposes microvm declaredRunner (if exists) as package output of this flake.
2# feel free to remove or adapt.
3{
4 den,
5 lib,
6 config,
7 ...
8}:
9let
10 # omit if you are using flake-parts. create a packages output for us.
11 packagesModule.options.flake.packages = lib.mkOption { };
12
13 microvmRunners = lib.pipe den.hosts [
14 lib.attrValues
15 (lib.concatMap lib.attrValues)
16 (map (
17 host:
18 let
19 osConf = lib.attrByPath host.intoAttr null config.flake;
20 vmRunner = osConf.config.microvm.declaredRunner or null;
21 package = lib.optionalAttrs (vmRunner != null) {
22 ${host.system}.${host.name} = vmRunner;
23 };
24 in
25 package
26 ))
27 ];
28in
29{
30 imports = [ packagesModule ];
31 flake.packages = lib.mkMerge microvmRunners;
32}