diff --git a/nt/primitives/bootstrap/default.nix b/nt/primitives/bootstrap/default.nix index 2a00701..44cb8fa 100644 --- a/nt/primitives/bootstrap/default.nix +++ b/nt/primitives/bootstrap/default.nix @@ -12,7 +12,10 @@ let ; # NOTE: bootstrap does the equivalent to mix's `include.public` option. - bootstrap = inputs: let + bootstrap = extraInputs: target: let + this = delegate target; + inputs = {inherit this;} // extraInputs; + delegate = target: # PATH if isPath target @@ -26,9 +29,9 @@ let # FUNCTION (OR FAIL) else target inputs; in - delegate; - - this = bootstrap {inherit this bootstrap;} [ + this; +in + bootstrap {} [ ./nt.nix { bootstrap = _: bootstrap; @@ -38,6 +41,4 @@ let maybe = ./maybe.nix; trapdoor = ./trapdoor.nix; } - ]; -in - this + ] diff --git a/nt/primitives/bootstrap/maybe.nix b/nt/primitives/bootstrap/maybe.nix index 08b49b9..72f04ae 100644 --- a/nt/primitives/bootstrap/maybe.nix +++ b/nt/primitives/bootstrap/maybe.nix @@ -1,4 +1,4 @@ -{this, ...}: let +{...}: let inherit (builtins) attrNames @@ -6,11 +6,6 @@ isAttrs typeOf ; - - inherit - (this.std) - id - ; in rec { # NOTE: Maybe intentionally doesn't use the NixTypes. # NOTE: Maybe is used to aid in parsing and bootstrapping. diff --git a/nt/primitives/bootstrap/parse/bootstrap.nix b/nt/primitives/bootstrap/parse/bootstrap.nix index bf91c18..9e6207b 100644 --- a/nt/primitives/bootstrap/parse/bootstrap.nix +++ b/nt/primitives/bootstrap/parse/bootstrap.nix @@ -1,7 +1,7 @@ # WARNING: /nt/primitives/bootstrap cannot depend on mix # WARNING: this file is strictly for bootstrapping nt -{bootstrap, ...} @ inputs: -bootstrap inputs [ +{this, ...} @ inputs: +this.bootstrap inputs [ ./parse.nix ./sig.nix ] diff --git a/nt/primitives/bootstrap/std/bootstrap.nix b/nt/primitives/bootstrap/std/bootstrap.nix index 5c5875e..b3ece14 100644 --- a/nt/primitives/bootstrap/std/bootstrap.nix +++ b/nt/primitives/bootstrap/std/bootstrap.nix @@ -1,14 +1,12 @@ # WARNING: /nt/primitives/bootstrap cannot depend on mix # WARNING: this file is strictly for bootstrapping nt -{bootstrap, ...}: let - # WARNING: do not propagate `this` from parent, bootstrap/std must - # WARNING: remain entirely independent from bootstrap - this = bootstrap {inherit this bootstrap;} [ - ./attrs.nix - ./fn.nix - ./list.nix - ./num.nix - ./string.nix - ]; -in - this +{this, ...}: +# WARNING: do not propagate `this` from parent, bootstrap/std must +# WARNING: remain entirely independent from bootstrap/ +this.bootstrap {} [ + ./attrs.nix + ./fn.nix + ./list.nix + ./num.nix + ./string.nix +]