diff --git a/lib/devos/mkProfileAttrs.nix b/lib/devos/mkProfileAttrs.nix index 214df2611..5fe3c7f7a 100644 --- a/lib/devos/mkProfileAttrs.nix +++ b/lib/devos/mkProfileAttrs.nix @@ -11,6 +11,19 @@ let mkProfileAttrs = Example: let profiles = mkProfileAttrs ./profiles; in assert profiles ? core.default; 0 + + Example folder layout: + profiles/core/default.nix + profiles/core/sub/default.nix + profiles/code/ignored-no-default-nix/ + profiles/other/default.nix + + Example result: + { + core = { default = "..." }; + sub = { default = "..." }; + other = { default = "..." }; + } **/ dir: let diff --git a/suites/default.nix b/suites/default.nix index 7eb11e503..42cb4f9bc 100644 --- a/suites/default.nix +++ b/suites/default.nix @@ -5,19 +5,15 @@ let profiles = dev.os.mkProfileAttrs (toString ../profiles); users = dev.os.mkProfileAttrs (toString ../users); - allProfiles = - let defaults = lib.collect (x: x ? default) profiles; - in map (x: x.default) defaults; + allProfiles = dev.os.profileMap (lib.attrVals profiles); - allUsers = - let defaults = lib.collect (x: x ? default) users; - in map (x: x.default) defaults; + allUsers = dev.os.profileMap (lib.attrVals users); suites = with profiles; rec { - base = [ users.nixos users.root ]; + base = dev.os.profileMap [ users.nixos users.root ]; }; in -lib.mapAttrs (_: v: dev.os.profileMap v) suites // { +suites // { inherit allProfiles allUsers; }