diff --git a/nt/mix/import.nix b/nt/mix/import.nix index 86f0990..964696b 100644 --- a/nt/mix/import.nix +++ b/nt/mix/import.nix @@ -72,7 +72,7 @@ in rec { then unwrapTerminal target # ATTRS else if isAttrs target - then target |> mapAttrs (_: value: delegate value) + then target # FUNCTION (OR FAIL) else assert isFunction target diff --git a/nt/mix/mixture.nix b/nt/mix/mixture.nix index 1a8f3e1..af7be1f 100644 --- a/nt/mix/mixture.nix +++ b/nt/mix/mixture.nix @@ -3,6 +3,12 @@ nt, ... }: let + inherit + (builtins) + attrNames + removeAttrs + ; + inherit (this) mkIncludes @@ -15,27 +21,29 @@ ; in { newMixture = inputs: modBuilder: let - # parse mixture declaration structure - decl = - modBuilder mixture.private - |> projectOnto - { - isolated = false; + templateDecl = { + isolated = false; - includes = { - public = []; - private = []; - protected = []; - }; - submods = { - public = []; - private = []; - protected = []; - }; - # XXX: TODO: are these needed? - # options = Terminal {}; - # config = Terminal {}; + includes = { + public = []; + private = []; + protected = []; }; + submods = { + public = []; + private = []; + protected = []; + }; + # XXX: TODO: are these needed? + # options = Terminal {}; + # config = Terminal {}; + }; + + # parse mixture declaration structure + decl' = modBuilder mixture.private; + decl = decl' |> projectOnto templateDecl; + + otherAttrs = removeAttrs decl' (attrNames templateDecl); inputBuilder = mixture: if decl.isolated @@ -61,7 +69,8 @@ in { mixture = { public = includes.public - // submods.public; + // submods.public + // otherAttrs; protected = includes.protected // submods.protected;