diff --git a/.envrc b/.envrc index aaff7ae..12824a7 100644 --- a/.envrc +++ b/.envrc @@ -1,4 +1,4 @@ -files=(shell.nix src/dev/shell.nix) +files=(shell.nix atom-nix/dev/shell.nix) watch_file "${files[@]}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 63e8d0c..868e378 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,20 +19,6 @@ jobs: - uses: nixbuild/nix-quick-install-action@v28 - name: Code Format Check run: eval "$(nix print-dev-env -f shell.nix)" && treefmt --fail-on-change - std-config: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: nixbuild/nix-quick-install-action@v28 - - name: Std Library Config Test - run: cd test/std-import && ./import.sh > /dev/null - features: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: nixbuild/nix-quick-install-action@v28 - - name: Feature Parsing Test - run: cd test/features && ./resolve.sh > /dev/null purity: runs-on: ubuntu-latest steps: diff --git a/atom-nix/README.md b/atom-nix/README.md index 921bddc..d3716c0 100644 --- a/atom-nix/README.md +++ b/atom-nix/README.md @@ -107,9 +107,6 @@ name = "dev" version = "0.1.0" description = "Development environment" -[features] -default = [] - [fetch.pkgs] name = "nixpkgs" import = true @@ -128,11 +125,7 @@ let atom = builtins.fetchGit "https://github.com/ekala-project/atom"; importAtom = import "${atom}/atom-nix/core/importAtom.nix"; in -importAtom { - features = [ - # enabled flags - ]; -} ./atom-nix/dev.toml +importAtom { } ./atom-nix/dev.toml ``` ## Future Directions: Ekala Platform diff --git a/atom-nix/core@.toml b/atom-nix/core/atom.toml similarity index 76% rename from atom-nix/core@.toml rename to atom-nix/core/atom.toml index 2e91a0a..900f3c3 100644 --- a/atom-nix/core@.toml +++ b/atom-nix/core/atom.toml @@ -2,7 +2,3 @@ id = "core" version = "0.3.0" description = "A purpose built, unopinionated, and performant module system for Nix code." - -[features] -std = [] -default = ["std"] diff --git a/atom-nix/core/compose.nix b/atom-nix/core/compose.nix index 5b1b91e..0049dca 100644 --- a/atom-nix/core/compose.nix +++ b/atom-nix/core/compose.nix @@ -57,40 +57,23 @@ let l = builtins; core = import ./mod.nix; in +root: { - src, - root, config, extern ? { }, - features ? [ ], - # internal features of the composer function - stdFeatures ? core.stdToml.features.default or [ ], - coreFeatures ? core.coreToml.features.default, # enable testing code paths __internal__test ? false, __isStd__ ? false, }: let - par = (root + "/${src}"); + par = core.prepDir root; std = core.importStd { - features = stdFeatures; inherit __internal__test; - } (../. + "/std@.toml"); - - coreFeatures' = core.features.resolve core.coreToml.features coreFeatures; - stdFeatures' = core.features.resolve core.stdToml.features stdFeatures; - - cfg = config // { - features = config.features or { } // { - resolved = { - atom = features; - core = coreFeatures'; - std = stdFeatures'; - }; - }; }; + cfg = config; + msg = core.errors.debugMsg config; f = @@ -105,21 +88,23 @@ let scope = let - scope' = with core; { - inherit cfg; - mod = modScope; - builtins = std; - import = errors.import; - scopedImport = errors.import; - __fetchurl = errors.fetch; - __currentSystem = errors.system; - __currentTime = errors.time 0; - __nixPath = errors.nixPath [ ]; - __storePath = errors.storePath; - __getEnv = errors.getEnv ""; - __getFlake = errors.import; - get = extern; - }; + scope' = + with core; + { + inherit cfg; + mod = modScope; + builtins = std; + import = errors.import; + scopedImport = errors.import; + __fetchurl = errors.fetch; + __currentSystem = errors.system; + __currentTime = errors.time 0; + __nixPath = errors.nixPath [ ]; + __storePath = errors.storePath; + __getEnv = errors.getEnv ""; + __getFlake = errors.import; + } + // extern; scope'' = core.set.inject scope' [ preOpt @@ -127,9 +112,6 @@ let _if = !__isStd__; atom = atomScope; _else.std = atomScope; - } - { - _if = !__isStd__ && l.elem "std" coreFeatures'; inherit std; } { @@ -206,10 +188,6 @@ let in core.set.inject fixed [ ({ _if = __isStd__; } // core.pureBuiltinsForStd fixed) - { - _if = __isStd__ && l.elem "lib" cfg.features.resolved.atom; - inherit (extern) lib; - } { _if = __isStd__ && __internal__test; __internal = { diff --git a/atom-nix/core/features.nix b/atom-nix/core/features.nix deleted file mode 100644 index 7241094..0000000 --- a/atom-nix/core/features.nix +++ /dev/null @@ -1,65 +0,0 @@ -let - l = builtins; -in -{ - /** - Resolve feature dependencies for Atom's module composer. - - This function takes a set of features and their dependencies, and an initial list of features. - It returns a list of all required features, including dependencies, without duplicates. - - # Examples - - Given a TOML file with feature declarations: - - ```toml - [features] - default = ["foo", "bar"] - foo = ["baz"] - bar = ["qux"] - baz = [] - qux = ["baz"] - ``` - - Nix usage: - - ```nix - features.resolve featureSet ["foo", "bar"] => ["foo", "baz", "bar", "qux"] - ``` - - # Type - - ``` - features.resolve :: AttrSet -> [String] -> [String] - ``` - - # Parameters - - - `featureSet`: An attribute set where keys are feature names and values are lists of dependencies. - - `initials`: A list of initially requested features. - - # Return Value - - A list of strings representing all required features, including dependencies, without duplicates. - - # Notes - - - The function handles circular dependencies. - - The order of features in the output list is not guaranteed. - - Features not present in the `featureSet` are ignored. - */ - resolve = - featureSet: initials: - let - resolve = - features: acc: - let - features' = l.filter (f: !(acc ? ${f})) features; - acc' = l.foldl' (a: f: a // { ${f} = null; }) acc features'; - in - if features' == [ ] then acc' else resolve (l.concatMap (f: featureSet.${f} or [ ]) features') acc'; - - resolved = resolve initials { }; - in - l.attrNames resolved; -} diff --git a/atom-nix/core/importAtom.nix b/atom-nix/core/importAtom.nix index f86ed6f..2ec4e2e 100644 --- a/atom-nix/core/importAtom.nix +++ b/atom-nix/core/importAtom.nix @@ -16,103 +16,28 @@ valid input (and the CLI should type check on it's end) */ { - features ? null, + remoteUrl ? null, __internal__test ? false, + }: -path': +root': let mod = import ./mod.nix; - path = mod.prepDir path'; + root = mod.prepDir root'; - file = builtins.readFile path; + file = builtins.readFile (root + "/atom.toml"); config = builtins.fromTOML file; atom = config.atom or { }; - id = builtins.seq version (atom.id or (mod.errors.missingAtom path' "id")); - version = atom.version or (mod.errors.missingAtom path' "version"); - - core = config.core or { }; - std = config.std or { }; - - features' = - let - featSet = config.features or { }; - featIn = if features == null then featSet.default or [ ] else features; - in - mod.features.resolve featSet featIn; - - backend = config.backend or { }; - nix = backend.nix or { }; - - root = mod.prepDir (dirOf path); - src = builtins.seq id ( - let - file = mod.parse (baseNameOf path); - len = builtins.stringLength file.name; - in - builtins.substring 0 (len - 1) file.name - ); - extern = - let - fetcher = nix.fetcher or "native"; # native doesn't exist yet - conf = config.fetcher or { }; - f = conf.${fetcher} or { }; - root = f.root or "npins"; - in - if fetcher == "npins" then - let - pins = import (dirOf path + "/${root}"); - in - mod.filterMap ( - k: v: - let - src = "${pins.${v.name or k}}/${v.subdir or ""}"; - val = - if v.import or false then - if v.args or [ ] != [ ] then - builtins.foldl' ( - f: x: - let - intersect = x // (builtins.intersectAttrs x extern); - in - if builtins.isAttrs x then f intersect else f x - ) (import src) v.args - else - import src - else - src; - in - if (v.optional or false && builtins.elem k features') || (!v.optional or false) then - { "${k}" = val; } - else - null - ) config.fetch or { } - # else if fetcher = "native", etc - else - { }; meta = atom.meta or { }; in -mod.compose { +mod.compose root { inherit - extern __internal__test config - root - src ; - features = features'; - coreFeatures = - let - feat = core.features or mod.coreToml.features.default; - in - mod.features.resolve mod.coreToml.features feat; - stdFeatures = - let - feat = std.features or mod.stdToml.features.default; - in - mod.features.resolve mod.stdToml.features feat; __isStd__ = meta.__is_std__ or false; } diff --git a/atom-nix/core/mod.nix b/atom-nix/core/mod.nix index 058ae54..b5f9004 100644 --- a/atom-nix/core/mod.nix +++ b/atom-nix/core/mod.nix @@ -21,8 +21,8 @@ let std = builtins; mod = scopedImport { inherit mod std; } ../std/string/mod.nix; } ../std/string/toLowerCase.nix; - stdToml = l.fromTOML (l.readFile (../. + "/std@.toml")); - coreToml = l.fromTOML (l.readFile (../. + "/core@.toml")); + stdToml = l.fromTOML (l.readFile (../std/atom.toml)); + coreToml = l.fromTOML (l.readFile (../core/atom.toml)); in rec { inherit @@ -32,6 +32,7 @@ rec { stdFilter stdToml coreToml + importAtom ; path = { @@ -49,8 +50,6 @@ rec { errors = import ./errors.nix; - features = import ./features.nix; - lowerKeys = filterMap (k: v: { ${toLowerCase k} = v; }); collectPublic = filterMap ( @@ -78,7 +77,12 @@ rec { ); }; - importStd = opts: importAtom { inherit (opts) __internal__test features; }; + importStd = + opts: + compose ../std { + inherit (opts) __internal__test; + __isStd__ = true; + }; modIsValid = mod: dir: diff --git a/atom-nix/dev/atom.lock b/atom-nix/dev/atom.lock new file mode 100644 index 0000000..1245375 --- /dev/null +++ b/atom-nix/dev/atom.lock @@ -0,0 +1,7 @@ +version = 1 + +[[deps]] +name = "nixpkgs" +url = "https://github.com/NixOS/nixpkgs/archive/c2ae88e026f9525daf89587f3cbee584b92b6134.tar.gz" +type = "pin+tar" +checksum = "sha256:1fsnvjvg7z2nvs876ig43f8z6cbhhma72cbxczs30ld0cqgy5dks" diff --git a/atom-nix/dev/atom.toml b/atom-nix/dev/atom.toml new file mode 100644 index 0000000..bfa91d3 --- /dev/null +++ b/atom-nix/dev/atom.toml @@ -0,0 +1,3 @@ +[atom] +id = "dev" +version = "0.2.0" diff --git a/atom-nix/dev/mod.nix b/atom-nix/dev/mod.nix index a540a34..2522c42 100644 --- a/atom-nix/dev/mod.nix +++ b/atom-nix/dev/mod.nix @@ -1 +1,4 @@ -{ Shell = mod.shell; } +{ + pkgs = from.nixpkgs { }; + Shell = mod.shell; +} diff --git a/atom-nix/dev/shell.nix b/atom-nix/dev/shell.nix index cb99462..a053a7a 100644 --- a/atom-nix/dev/shell.nix +++ b/atom-nix/dev/shell.nix @@ -1,10 +1,9 @@ { - pkgs ? get.pkgs, + pkgs ? mod.pkgs, }: pkgs.mkShell { packages = with pkgs; [ treefmt - npins nixfmt-rfc-style shfmt taplo diff --git a/atom-nix/dev@.toml b/atom-nix/dev@.toml deleted file mode 100644 index 54b2022..0000000 --- a/atom-nix/dev@.toml +++ /dev/null @@ -1,21 +0,0 @@ -[atom] -id = "dev" -version = "0.2.0" - -[fetch.pkgs] -name = "nixpkgs" -import = true -args = [{}] - -[core] -features = ["std"] -[std] -features = ["lib"] - -[backend.nix] -# default when `eka` cli is ready -# fetcher = "native" -fetcher = "npins" - -[fetcher.npins] -root = "npins" diff --git a/atom-nix/npins/default.nix b/atom-nix/npins/default.nix deleted file mode 100644 index 5e7d086..0000000 --- a/atom-nix/npins/default.nix +++ /dev/null @@ -1,80 +0,0 @@ -# Generated by npins. Do not modify; will be overwritten regularly -let - data = builtins.fromJSON (builtins.readFile ./sources.json); - version = data.version; - - mkSource = - spec: - assert spec ? type; - let - path = - if spec.type == "Git" then - mkGitSource spec - else if spec.type == "GitRelease" then - mkGitSource spec - else if spec.type == "PyPi" then - mkPyPiSource spec - else if spec.type == "Channel" then - mkChannelSource spec - else - builtins.throw "Unknown source type ${spec.type}"; - in - spec // { outPath = path; }; - - mkGitSource = - { - repository, - revision, - url ? null, - hash, - branch ? null, - ... - }: - assert repository ? type; - # At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository - # In the latter case, there we will always be an url to the tarball - if url != null then - (builtins.fetchTarball { - inherit url; - sha256 = hash; # FIXME: check nix version & use SRI hashes - }) - else - assert repository.type == "Git"; - let - urlToName = - url: rev: - let - matched = builtins.match "^.*/([^/]*)(\\.git)?$" repository.url; - - short = builtins.substring 0 7 rev; - - appendShort = if (builtins.match "[a-f0-9]*" rev) != null then "-${short}" else ""; - in - "${if matched == null then "source" else builtins.head matched}${appendShort}"; - name = urlToName repository.url revision; - in - builtins.fetchGit { - url = repository.url; - rev = revision; - inherit name; - # hash = hash; - }; - - mkPyPiSource = - { url, hash, ... }: - builtins.fetchurl { - inherit url; - sha256 = hash; - }; - - mkChannelSource = - { url, hash, ... }: - builtins.fetchTarball { - inherit url; - sha256 = hash; - }; -in -if version == 3 then - builtins.mapAttrs (_: mkSource) data.pins -else - throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`" diff --git a/atom-nix/npins/sources.json b/atom-nix/npins/sources.json deleted file mode 100644 index a66a32d..0000000 --- a/atom-nix/npins/sources.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "pins": { - "nixpkgs": { - "type": "Channel", - "name": "nixpkgs-unstable", - "url": "https://releases.nixos.org/nixpkgs/nixpkgs-24.11pre660607.c3392ad349a5/nixexprs.tar.xz", - "hash": "1g2p74w085252qbxjymrzzccd203bfwxh8sbcyvbzan6bgqfvwi1" - }, - "nixpkgs.lib": { - "type": "Git", - "repository": { - "type": "GitHub", - "owner": "nix-community", - "repo": "nixpkgs.lib" - }, - "branch": "master", - "revision": "8bebd4c74f368aacb047f0141db09ec6b339733c", - "url": "https://github.com/nix-community/nixpkgs.lib/archive/8bebd4c74f368aacb047f0141db09ec6b339733c.tar.gz", - "hash": "0vzy9hs0k8zi9h4lx1krq578j3wdc62d6g4hddxj9sfkdmz8r3bn" - } - }, - "version": 3 -} \ No newline at end of file diff --git a/atom-nix/std/atom.toml b/atom-nix/std/atom.toml new file mode 100644 index 0000000..a2eebb0 --- /dev/null +++ b/atom-nix/std/atom.toml @@ -0,0 +1,9 @@ +[atom] +id = "std" +version = "0.2.0" +description = "Nix Standard Library" + +[atom.meta] +# special attribute +# for the Nix std library +__is_std__ = true diff --git a/atom-nix/std/set/mergeUntil.nix b/atom-nix/std/set/mergeUntil.nix index 0c9b8da..be66e79 100644 --- a/atom-nix/std/set/mergeUntil.nix +++ b/atom-nix/std/set/mergeUntil.nix @@ -69,7 +69,9 @@ let f here values ); in -f [ ] [ - rhs - lhs -] +f + [ ] + [ + rhs + lhs + ] diff --git a/atom-nix/std@.toml b/atom-nix/std@.toml deleted file mode 100644 index 77b5d27..0000000 --- a/atom-nix/std@.toml +++ /dev/null @@ -1,26 +0,0 @@ -[atom] -id = "std" -version = "0.2.0" -description = "Nix Standard Library" - -[fetch.lib] # the name in `atom` scope -name = "nixpkgs.lib" # the name in npins -import = true -subdir = "lib" -optional = true -# TODO: fetched at eval time -type = "lib" -# TODO: fetched at buildtime -# type = "src" - -[backend.nix] -fetcher = "npins" - -[atom.meta] -# special attribute -# for the Nix std library -__is_std__ = true - -[features] -lib = [] -default = [] diff --git a/shell.nix b/shell.nix index 06dc9c3..6a35171 100644 --- a/shell.nix +++ b/shell.nix @@ -1,4 +1,4 @@ let - dev = (import ./atom-nix/core/importAtom.nix) { } (./. + "/atom-nix/dev@.toml"); + dev = (import ./atom-nix/core/importAtom.nix) { } (./atom-nix/dev); in dev.shell diff --git a/test/features/recursive-features b/test/features/recursive-features deleted file mode 120000 index 48879a0..0000000 --- a/test/features/recursive-features +++ /dev/null @@ -1 +0,0 @@ -resolve \ No newline at end of file diff --git a/test/features/recursive-features-loop b/test/features/recursive-features-loop deleted file mode 120000 index 48879a0..0000000 --- a/test/features/recursive-features-loop +++ /dev/null @@ -1 +0,0 @@ -resolve \ No newline at end of file diff --git a/test/features/recursive-features-loop@.toml b/test/features/recursive-features-loop@.toml deleted file mode 100644 index 7da0640..0000000 --- a/test/features/recursive-features-loop@.toml +++ /dev/null @@ -1,8 +0,0 @@ -[atom] -id = "features-loop" -version = "0.1.0" - -[features] -a = ["b", "c"] -c = ["b"] -default = ["a"] diff --git a/test/features/recursive-features@.toml b/test/features/recursive-features@.toml deleted file mode 100644 index 86b937a..0000000 --- a/test/features/recursive-features@.toml +++ /dev/null @@ -1,8 +0,0 @@ -[atom] -id = "features" -version = "0.1.0" - -[features] -a = ["b"] -b = ["c"] -default = ["a"] diff --git a/test/features/resolve.nix b/test/features/resolve.nix deleted file mode 100644 index 5d2f78e..0000000 --- a/test/features/resolve.nix +++ /dev/null @@ -1,7 +0,0 @@ -let - f = import ../../atom-nix/core/importAtom.nix { __internal__test = true; }; -in -{ - recursive-features = f (./. + "/recursive-features@.toml"); - recursive-features-loop = f (./. + "/recursive-features-loop@.toml"); -} diff --git a/test/features/resolve.sh b/test/features/resolve.sh deleted file mode 100755 index 763d75c..0000000 --- a/test/features/resolve.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -f="$(nix eval -f resolve.nix recursive-features.resolved)" -[[ "$f" == '[ "a" "b" "c" ]' ]] - -f="$(nix eval -f resolve.nix recursive-features-loop.resolved)" -[[ "$f" == '[ "a" "b" "c" ]' ]] diff --git a/test/features/resolve/mod.nix b/test/features/resolve/mod.nix deleted file mode 100644 index cd40ea6..0000000 --- a/test/features/resolve/mod.nix +++ /dev/null @@ -1,6 +0,0 @@ -let - inherit (__internal) scope; -in -{ - Resolved = cfg.features.resolved.atom; -} diff --git a/test/integrity/bld.nix b/test/integrity/bld.nix index 7ad6393..800cbaa 100644 --- a/test/integrity/bld.nix +++ b/test/integrity/bld.nix @@ -2,7 +2,7 @@ let f = import ../../atom-nix/core/importAtom.nix; atom = f { } ( # added to test implicit path conversion when path is a string - builtins.toPath (./. + "/bld@.toml") + builtins.toPath ./bld ); in builtins.deepSeq atom atom diff --git a/test/integrity/bld@.toml b/test/integrity/bld/atom.toml similarity index 100% rename from test/integrity/bld@.toml rename to test/integrity/bld/atom.toml diff --git a/test/pre.nix b/test/pre.nix index bd79030..e6b9829 100644 --- a/test/pre.nix +++ b/test/pre.nix @@ -1 +1 @@ -(import ../atom-nix/core/importAtom.nix { }) (./. + "/pre@.toml") +(import ../atom-nix/core/importAtom.nix { }) ./pre diff --git a/test/pre@.toml b/test/pre/atom.toml similarity index 100% rename from test/pre@.toml rename to test/pre/atom.toml diff --git a/test/purity/purity.nix b/test/purity/purity.nix index ffe10fa..107d11d 100644 --- a/test/purity/purity.nix +++ b/test/purity/purity.nix @@ -2,7 +2,7 @@ let f = import ../../atom-nix/core/importAtom.nix; atom = f { __internal__test = true; } ( # added to test implicit path conversion when path is a string - builtins.toPath (./. + "/test@.toml") + builtins.toPath ./test ); in atom diff --git a/test/purity/test@.toml b/test/purity/test/atom.toml similarity index 100% rename from test/purity/test@.toml rename to test/purity/test/atom.toml diff --git a/test/scope.toml b/test/scope.toml deleted file mode 100644 index 3215b58..0000000 --- a/test/scope.toml +++ /dev/null @@ -1,18 +0,0 @@ -[fetch.lib] -name = "nixpkgs.lib" -import = true -sub = "lib" -optional = true - -[features] -lib = [] -default = [] - -[backends.nix] -root = "std" -fetcher = "npins" - -[project.meta] -# special attribute -# for the Nix std library -__is_std__ = true diff --git a/test/std-import/default b/test/std-import/default deleted file mode 120000 index efca996..0000000 --- a/test/std-import/default +++ /dev/null @@ -1 +0,0 @@ -import \ No newline at end of file diff --git a/test/std-import/default@.toml b/test/std-import/default@.toml deleted file mode 100644 index 84239b5..0000000 --- a/test/std-import/default@.toml +++ /dev/null @@ -1,3 +0,0 @@ -[atom] -id = "std-test" -version = "0.1.0" diff --git a/test/std-import/explicit b/test/std-import/explicit deleted file mode 120000 index efca996..0000000 --- a/test/std-import/explicit +++ /dev/null @@ -1 +0,0 @@ -import \ No newline at end of file diff --git a/test/std-import/explicit@.toml b/test/std-import/explicit@.toml deleted file mode 100644 index 1127c58..0000000 --- a/test/std-import/explicit@.toml +++ /dev/null @@ -1,8 +0,0 @@ -[atom] -id = "explicit-test" -version = "0.1.0" - -[core] -features = ["std"] -[std] -features = [] diff --git a/test/std-import/import.nix b/test/std-import/import.nix deleted file mode 100644 index cd02e5c..0000000 --- a/test/std-import/import.nix +++ /dev/null @@ -1,9 +0,0 @@ -let - f = import ../../atom-nix/core/importAtom.nix { __internal__test = true; }; -in -{ - default = f (./. + "/default@.toml"); - noStd = f (./. + "/no-std@.toml"); - explicit = f (./. + "/explicit@.toml"); - withLib = f (./. + "/with-lib@.toml"); -} diff --git a/test/std-import/import.sh b/test/std-import/import.sh deleted file mode 100755 index 71034a3..0000000 --- a/test/std-import/import.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -# defaults -f="$(nix eval -f import.nix default.coreF)" -[[ "$f" == '[ "std" ]' ]] -f="$(nix eval -f import.nix default.std)" -[[ "$f" == true ]] -f="$(nix eval -f import.nix default.lib)" -[[ "$f" == false ]] -f="$(nix eval -f import.nix default.sanity)" -[[ "$f" == true ]] - -# explicit -f="$(nix eval -f import.nix explicit.coreF)" -[[ "$f" == '[ "std" ]' ]] -f="$(nix eval -f import.nix explicit.std)" -[[ "$f" == true ]] -f="$(nix eval -f import.nix explicit.lib)" -[[ "$f" == false ]] - -# no std set -f="$(nix eval -f import.nix noStd.coreF)" -[[ "$f" == '[ ]' ]] -f="$(nix eval -f import.nix noStd.std)" -[[ "$f" == false ]] -f="$(nix eval -f import.nix noStd.lib)" -[[ "$f" == false ]] - -# no std set -f="$(nix eval -f import.nix withLib.stdF)" -[[ "$f" == '[ "lib" ]' ]] -f="$(nix eval -f import.nix withLib.std)" -[[ "$f" == true ]] -f="$(nix eval -f import.nix withLib.lib)" -[[ "$f" == true ]] diff --git a/test/std-import/import/mod.nix b/test/std-import/import/mod.nix deleted file mode 100644 index 1a73bcb..0000000 --- a/test/std-import/import/mod.nix +++ /dev/null @@ -1,10 +0,0 @@ -let - inherit (__internal) scope; -in -{ - Std = scope ? std; - Lib = scope ? std && scope.std ? lib; - CoreF = cfg.features.resolved.core; - StdF = cfg.features.resolved.std; - Sanity = scope.std.__internal.__isStd__; -} diff --git a/test/std-import/no-std b/test/std-import/no-std deleted file mode 120000 index efca996..0000000 --- a/test/std-import/no-std +++ /dev/null @@ -1 +0,0 @@ -import \ No newline at end of file diff --git a/test/std-import/no-std@.toml b/test/std-import/no-std@.toml deleted file mode 100644 index bba4291..0000000 --- a/test/std-import/no-std@.toml +++ /dev/null @@ -1,6 +0,0 @@ -[atom] -id = "no-std-test" -version = "0.1.0" - -[core] -features = [] # default is ["std"] diff --git a/test/std-import/with-lib b/test/std-import/with-lib deleted file mode 120000 index efca996..0000000 --- a/test/std-import/with-lib +++ /dev/null @@ -1 +0,0 @@ -import \ No newline at end of file diff --git a/test/std-import/with-lib@.toml b/test/std-import/with-lib@.toml deleted file mode 100644 index 8902549..0000000 --- a/test/std-import/with-lib@.toml +++ /dev/null @@ -1,6 +0,0 @@ -[atom] -id = "with-lib-test" -version = "0.1.0" - -[std] -features = ["lib"]