Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/core/compose.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -197,7 +209,7 @@ let
# Base case: no module
{ };

atomScope = l.removeAttrs (extern // atom // { inherit extern; }) [
atomScope = l.removeAttrs atom [
"atom"
(baseNameOf par)
];
Expand Down
2 changes: 1 addition & 1 deletion src/core/errors.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
Expand Down
8 changes: 5 additions & 3 deletions src/core/importAtom.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
valid input (and the CLI should type check on it's end)
*/
{
system ? null,
features ? null,
__internal__test ? false,
}:
Expand Down Expand Up @@ -96,11 +97,12 @@ let
in
mod.compose {
inherit
src
root
config
system
extern
__internal__test
config
root
src
;
features = features';
coreFeatures =
Expand Down
2 changes: 1 addition & 1 deletion src/dev/shell.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
pkgs ? atom.pkgs,
pkgs ? use.pkgs,
}:
pkgs.mkShell {
packages = with pkgs; [
Expand Down