diff --git a/src/core/compose.nix b/src/core/compose.nix index 55b957d..f78fa12 100644 --- a/src/core/compose.nix +++ b/src/core/compose.nix @@ -56,11 +56,13 @@ let l = builtins; core = import ./mod.nix; + in { src, root, config, + system ? null, extern ? { }, features ? [ ], # internal features of the composer function @@ -78,6 +80,8 @@ let inherit __internal__test; } (../. + "/std@.toml"); + systemIsDefined = system != null; + coreFeatures' = core.features.resolve core.coreToml.features coreFeatures; stdFeatures' = core.features.resolve core.stdToml.features stdFeatures; @@ -134,6 +138,14 @@ let _if = __isStd__; std = l.removeAttrs (extern // atom) [ "std" ]; } + { + _if = !__isStd__ && systemIsDefined; + inherit system; + } + { + _if = !__isStd__; + use = l.removeAttrs extern [ "std" ]; + } { _if = __internal__test; # information about the internal module system itself @@ -197,7 +209,7 @@ let # Base case: no module { }; - atomScope = l.removeAttrs (extern // atom // { inherit extern; }) [ + atomScope = l.removeAttrs atom [ "atom" (baseNameOf par) ]; diff --git a/src/core/errors.nix b/src/core/errors.nix index b7e3f42..43e169a 100644 --- a/src/core/errors.nix +++ b/src/core/errors.nix @@ -44,7 +44,7 @@ in modFromDir (stripParentDir par path); import = abort "Importing arbitrary Nix files is forbidden. Declare your dependencies via the module system instead."; fetch = abort "Ad hoc fetching is illegal. Declare dependencies statically in the manifest instead."; - system = abort "Accessing the current system is impure. Declare supported systems in the manifest."; + system = abort "`system` has been accessed and is undefined"; time = _: warn "currentTime: Ignoring request for current time, returning: 0"; nixPath = _: warn "nixPath: ignoring impure NIX_PATH request, returning: []"; storePath = abort "Making explicit dependencies on store paths is illegal."; diff --git a/src/core/importAtom.nix b/src/core/importAtom.nix index f86ed6f..5c31907 100644 --- a/src/core/importAtom.nix +++ b/src/core/importAtom.nix @@ -16,6 +16,7 @@ valid input (and the CLI should type check on it's end) */ { + system ? null, features ? null, __internal__test ? false, }: @@ -96,11 +97,12 @@ let in mod.compose { inherit + src + root + config + system extern __internal__test - config - root - src ; features = features'; coreFeatures = diff --git a/src/dev/shell.nix b/src/dev/shell.nix index 8c77a8f..e22c625 100644 --- a/src/dev/shell.nix +++ b/src/dev/shell.nix @@ -1,5 +1,5 @@ { - pkgs ? atom.pkgs, + pkgs ? use.pkgs, }: pkgs.mkShell { packages = with pkgs; [