cluster/simulacrum: recursive service deps

This commit is contained in:
Max Headroom 2024-08-11 00:50:00 +02:00
parent f37fed0ebb
commit e2ebdd097e

View file

@ -4,9 +4,15 @@
let let
serviceConfig = config.cluster.config.services.${service}; serviceConfig = config.cluster.config.services.${service};
serviceList = [ service ] ++ serviceConfig.simulacrum.deps; serviceList = getDepsRecursive [] service;
allAugments = map (svc: config.cluster.config.services.${svc}.simulacrum.augments) serviceList; allAugments = map (svc: config.cluster.config.services.${svc}.simulacrum.augments) serviceList;
getDepsRecursive = acc: service: let
deps = lib.subtractLists acc config.cluster.config.services.${service}.simulacrum.deps;
acc' = acc ++ [ service ];
recurse = getDepsRecursive acc';
in lib.unique (lib.flatten ([ service ] ++ map recurse deps));
lift = config; lift = config;
snakeoil = { snakeoil = {