From 935959858bd97789410d51f88fbbebe8072b5c1d Mon Sep 17 00:00:00 2001 From: Emile Clark-Boman Date: Wed, 28 Jan 2026 16:38:01 +1000 Subject: [PATCH] allow isolated modules --- nt/mix/mixture.nix | 9 +++++++-- nt/primitives/default.nix | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/nt/mix/mixture.nix b/nt/mix/mixture.nix index e4d305a..1a8f3e1 100644 --- a/nt/mix/mixture.nix +++ b/nt/mix/mixture.nix @@ -20,6 +20,8 @@ in { modBuilder mixture.private |> projectOnto { + isolated = false; + includes = { public = []; private = []; @@ -35,8 +37,11 @@ in { # config = Terminal {}; }; - mkInputs = mixture: {this = mixture;} // inputs; - descendentInputs = mkInputs mixture.protected; + inputBuilder = mixture: + if decl.isolated + then inputs // {this = mixture;} + else {this = mixture;} // inputs; + descendentInputs = inputBuilder mixture.protected; mkMixtureIncludes = layer: mkIncludes decl.includes.${layer} descendentInputs; mkMixtureSubMods = layer: mkSubMods decl.submods.${layer} descendentInputs; diff --git a/nt/primitives/default.nix b/nt/primitives/default.nix index f1c9e24..afc8965 100644 --- a/nt/primitives/default.nix +++ b/nt/primitives/default.nix @@ -1,10 +1,10 @@ {mix, ...} @ inputs: mix.newMixture inputs (mixture: { + isolated = true; includes.public = [ ./nt ]; - # XXX: TODO: submods.protected STILL doesn't work?? - submods.public = [ + submods.protected = [ ./std ]; })