use regular paths for profiles and suites and stuff instead of the horrible mess of attrsets i was generating

This commit is contained in:
xunuwu 2025-05-10 08:20:39 +02:00
parent 530f517d22
commit b9d92a9dc4
10 changed files with 181 additions and 200 deletions

View file

@ -1,29 +1,10 @@
l: let
b = builtins;
in rec {
loadBranch = branch:
l.mapAttrs' (leaf: _: {
name = l.removeSuffix ".nix" leaf;
value = /${branch}/${leaf};
}) (b.readDir /${branch});
loadTree2 = dir: (l.mapAttrs (branch: _: loadBranch /${dir}/${branch})) (b.readDir dir);
loadTreeInf = dir:
l.mapAttrs' (
name: value: {
name = l.removeSuffix ".nix" name;
value =
if value == "directory"
then loadTreeInf (dir + /${name})
else (dir + /${name});
}
) (b.readDir dir);
loadConfigurations = dir: specialArgs:
in {
loadConfigurations = dir: specialArgsFromHost:
(b.mapAttrs (name: _:
l.nixosSystem {
modules = [(dir + /${name})];
inherit specialArgs;
specialArgs = specialArgsFromHost name;
})) (b.readDir dir);
}