├── cli └── tests │ ├── .skip-tree │ ├── import.nix │ └── six.nix ├── crate-hashes.json ├── glue ├── src │ ├── tests │ │ ├── dummy │ │ │ └── .keep │ │ ├── empty-file │ │ ├── nix_tests │ │ │ ├── eval-okay-context.exp │ │ │ ├── eval-okay-context-introspection.exp │ │ │ └── eval-okay-context.nix │ │ ├── tvix_tests │ │ │ ├── eval-fail-fetchurl-invalid-url.nix │ │ │ ├── eval-fail-fetchtarball-invalid-url.nix │ │ │ ├── eval-okay-storePath.exp │ │ │ ├── eval-okay-context-introspection.exp │ │ │ ├── eval-okay-toxml-context.exp │ │ │ ├── eval-okay-storePath2.exp │ │ │ ├── eval-okay-context-propagation.exp │ │ │ ├── eval-fail-fetchurl-invalid-attrs.nix │ │ │ ├── eval-fail-tofile-wrongctxtype.nix │ │ │ ├── eval-fail-fetchtarball-invalid-attrs.nix │ │ │ ├── eval-okay-tofile.exp │ │ │ └── eval-okay-storePath2.nix │ │ ├── blob.tar.bz2 │ │ ├── blob.tar.gz │ │ └── blob.tar.xz │ └── .skip-subtree └── build.rs ├── eval ├── src │ ├── tests │ │ ├── nix_tests │ │ │ ├── data │ │ │ ├── readDir │ │ │ │ ├── bar │ │ │ │ ├── ldir │ │ │ │ ├── foo │ │ │ │ │ └── git-hates-directories │ │ │ │ └── linked │ │ │ ├── dir1 │ │ │ │ └── a.nix │ │ │ ├── dir2 │ │ │ │ ├── a.nix │ │ │ │ └── b.nix │ │ │ ├── dir3 │ │ │ │ ├── a.nix │ │ │ │ ├── b.nix │ │ │ │ └── c.nix │ │ │ ├── dir4 │ │ │ │ ├── a.nix │ │ │ │ └── c.nix │ │ │ ├── eval-okay-hash.exp │ │ │ ├── eval-okay-if.exp │ │ │ ├── eval-okay-seq.exp │ │ │ ├── eval-okay-attrs.exp │ │ │ ├── eval-okay-attrs2.exp │ │ │ ├── eval-okay-eq.exp │ │ │ ├── eval-okay-logic.exp │ │ │ ├── eval-okay-remove.exp │ │ │ ├── eval-okay-scope-1.exp │ │ │ ├── eval-okay-scope-2.exp │ │ │ ├── eval-okay-scope-3.exp │ │ │ ├── eval-okay-scope-7.exp │ │ │ ├── imported2.nix │ │ │ ├── eval-okay-arithmetic.exp │ │ │ ├── eval-okay-builtins.exp │ │ │ ├── eval-okay-deepseq.exp │ │ │ ├── eval-okay-empty-args.exp │ │ │ ├── eval-okay-fromjson.exp │ │ │ ├── eval-okay-getenv.exp │ │ │ ├── eval-okay-let.exp │ │ │ ├── eval-okay-nested-with.exp │ │ │ ├── eval-okay-pathexists.exp │ │ │ ├── eval-okay-scope-4.exp │ │ │ ├── eval-okay-scope-6.exp │ │ │ ├── eval-okay-versions.exp │ │ │ ├── parse-fail-uft8.nix │ │ │ ├── parse-fail-undef-var.nix │ │ │ ├── eval-okay-callable-attrs.exp │ │ │ ├── eval-okay-catattrs.exp │ │ │ ├── eval-okay-dynamic-attrs-2.exp │ │ │ ├── eval-okay-flatten.exp │ │ │ ├── eval-okay-foldlStrict.exp │ │ │ ├── eval-okay-list.exp │ │ │ ├── eval-okay-listtoattrs.exp │ │ │ ├── eval-okay-regex-match.exp │ │ │ ├── eval-okay-regex-split.exp │ │ │ ├── eval-okay-seq.nix │ │ │ ├── eval-okay-tail-call-1.exp │ │ │ ├── parse-fail-dup-formals.nix │ │ │ ├── eval-fail-bad-antiquote-1.nix │ │ │ ├── eval-okay-attrnames.exp │ │ │ ├── eval-okay-elem.exp │ │ │ ├── eval-okay-float.exp │ │ │ ├── eval-okay-new-let.exp │ │ │ ├── eval-okay-null-dynamic-attrs.exp │ │ │ ├── eval-okay-redefine-builtin.exp │ │ │ ├── eval-okay-regression-20220122.exp │ │ │ ├── eval-okay-regression-20220125.exp │ │ │ ├── eval-okay-with.exp │ │ │ ├── notyetpassing │ │ │ │ ├── eval-okay-overrides.exp │ │ │ │ ├── eval-okay-curpos.exp │ │ │ │ ├── eval-okay-search-path.exp │ │ │ │ ├── eval-okay-floor-ceil.exp │ │ │ │ ├── eval-okay-getattrpos-undefined.exp │ │ │ │ ├── eval-fail-bad-antiquote-2.nix │ │ │ │ ├── eval-okay-autoargs.exp │ │ │ │ ├── eval-okay-import.exp │ │ │ │ ├── eval-okay-context.exp │ │ │ │ ├── eval-okay-eq-derivations.exp │ │ │ │ ├── eval-okay-delayed-with.exp │ │ │ │ ├── eval-okay-context-introspection.exp │ │ │ │ ├── eval-okay-search-path.flags │ │ │ │ ├── eval-fail-undeclared-arg.nix │ │ │ │ ├── eval-okay-getattrpos-undefined.nix │ │ │ │ ├── eval-okay-attrs6.exp │ │ │ │ ├── eval-okay-getattrpos.exp │ │ │ │ ├── eval-okay-fromTOML-timestamps.flags │ │ │ │ ├── eval-okay-autoargs.flags │ │ │ │ ├── eval-okay-attrs6.nix │ │ │ │ ├── eval-okay-replacestrings.exp │ │ │ │ ├── eval-okay-getattrpos-functionargs.exp │ │ │ │ ├── eval-okay-curpos.nix │ │ │ │ ├── eval-fail-scope-5.nix │ │ │ │ ├── eval-okay-overrides.nix │ │ │ │ ├── eval-okay-getattrpos.nix │ │ │ │ ├── eval-okay-getattrpos-functionargs.nix │ │ │ │ ├── eval-okay-path-antiquotation.exp │ │ │ │ ├── eval-fail-nonexist-path.nix │ │ │ │ ├── eval-okay-path.nix │ │ │ │ ├── eval-okay-context.nix │ │ │ │ ├── eval-okay-zipAttrsWith.nix │ │ │ │ ├── eval-okay-floor-ceil.nix │ │ │ │ └── eval-okay-path-antiquotation.nix │ │ │ ├── parse-okay-1.nix │ │ │ ├── eval-fail-bad-antiquote-3.nix │ │ │ ├── eval-okay-attrs3.exp │ │ │ ├── eval-okay-backslash-newline-1.exp │ │ │ ├── eval-okay-backslash-newline-1.nix │ │ │ ├── eval-okay-backslash-newline-2.exp │ │ │ ├── eval-okay-concat.exp │ │ │ ├── eval-okay-foldlStrict-lazy-elements.exp │ │ │ ├── eval-okay-map.exp │ │ │ ├── eval-okay-patterns.exp │ │ │ ├── eval-okay-splitversion.exp │ │ │ ├── eval-okay-strings-as-attrs-names.exp │ │ │ ├── eval-fail-seq.nix │ │ │ ├── eval-fail-to-path.nix │ │ │ ├── eval-okay-backslash-newline-2.nix │ │ │ ├── eval-okay-delayed-with-inherit.exp │ │ │ ├── eval-okay-readDir.nix │ │ │ ├── eval-okay-substring.exp │ │ │ ├── parse-fail-patterns-1.nix │ │ │ ├── eval-okay-comments.exp │ │ │ ├── eval-okay-concat.nix │ │ │ ├── eval-okay-foldlStrict-lazy-initial-accumulator.exp │ │ │ ├── eval-okay-mapattrs.exp │ │ │ ├── eval-okay-builtins-add.exp │ │ │ ├── eval-okay-null-dynamic-attrs.nix │ │ │ ├── eval-okay-regression-20220122.nix │ │ │ ├── eval-okay-splitversion.nix │ │ │ ├── eval-fail-abort.nix │ │ │ ├── eval-fail-deepseq.nix │ │ │ ├── eval-okay-concatmap.exp │ │ │ ├── eval-okay-filter.exp │ │ │ ├── eval-okay-logic.nix │ │ │ ├── eval-fail-substring.nix │ │ │ ├── eval-okay-any-all.exp │ │ │ ├── eval-okay-attrs4.exp │ │ │ ├── eval-okay-attrs5.exp │ │ │ ├── eval-okay-nested-with.nix │ │ │ ├── eval-okay-readfile.exp │ │ │ ├── eval-okay-readfile.nix │ │ │ ├── eval-fail-missing-arg.nix │ │ │ ├── eval-okay-empty-args.nix │ │ │ ├── eval-okay-if.nix │ │ │ ├── eval-okay-path.exp │ │ │ ├── parse-fail-dup-attrs-1.nix │ │ │ ├── eval-fail-blackhole.nix │ │ │ ├── eval-okay-concatstringssep.exp │ │ │ ├── eval-okay-dynamic-attrs-2.nix │ │ │ ├── eval-okay-toxml2.nix │ │ │ ├── eval-okay-catattrs.nix │ │ │ ├── eval-okay-deepseq.nix │ │ │ ├── eval-okay-let.nix │ │ │ ├── parse-fail-mixed-nested-attrs1.nix │ │ │ ├── parse-okay-regression-751.nix │ │ │ ├── eval-fail-assert.nix │ │ │ ├── eval-okay-scope-1.nix │ │ │ ├── eval-okay-scope-7.nix │ │ │ ├── eval-okay-tail-call-1.nix │ │ │ ├── parse-fail-dup-attrs-4.nix │ │ │ ├── parse-fail-mixed-nested-attrs2.nix │ │ │ ├── parse-okay-mixed-nested-attrs-1.nix │ │ │ ├── parse-okay-mixed-nested-attrs-2.nix │ │ │ ├── eval-okay-eq.nix │ │ │ ├── eval-okay-map.nix │ │ │ ├── eval-okay-readDir.exp │ │ │ ├── eval-okay-foldlStrict.nix │ │ │ ├── eval-okay-readFileType.exp │ │ │ ├── eval-okay-regression-20220125.nix │ │ │ ├── eval-okay-scope-2.nix │ │ │ ├── eval-fail-remove.nix │ │ │ ├── eval-okay-callable-attrs.nix │ │ │ ├── eval-okay-redefine-builtin.nix │ │ │ ├── eval-okay-remove.nix │ │ │ ├── parse-okay-dup-attrs-5.nix │ │ │ ├── parse-okay-dup-attrs-6.nix │ │ │ ├── eval-okay-getenv.nix │ │ │ ├── eval-okay-list.nix │ │ │ ├── parse-fail-dup-attrs-7.nix │ │ │ ├── eval-okay-partition.exp │ │ │ ├── eval-okay-scope-3.nix │ │ │ ├── eval-okay-scope-6.nix │ │ │ ├── eval-okay-string.exp │ │ │ ├── eval-okay-mapattrs.nix │ │ │ ├── parse-fail-eof-in-string.nix │ │ │ ├── eval-okay-dynamic-attrs.exp │ │ │ ├── parse-fail-undef-var-2.nix │ │ │ ├── eval-okay-dynamic-attrs-bare.exp │ │ │ ├── eval-okay-tryeval.exp │ │ │ ├── eval-okay-tryeval.nix │ │ │ ├── imported.nix │ │ │ ├── eval-okay-filter.nix │ │ │ ├── eval-okay-flatten.nix │ │ │ ├── eval-okay-float.nix │ │ │ ├── eval-okay-attrs.nix │ │ │ ├── eval-okay-elem.nix │ │ │ ├── eval-okay-partition.nix │ │ │ ├── eval-okay-groupBy.nix │ │ │ ├── eval-okay-scope-4.nix │ │ │ ├── eval-okay-toxml.exp │ │ │ ├── eval-okay-toxml.nix │ │ │ ├── eval-okay-hashfile.nix │ │ │ ├── parse-fail-regression-20060610.nix │ │ │ ├── parse-okay-mixed-nested-attrs-3.nix │ │ │ ├── parse-fail-dup-attrs-2.nix │ │ │ ├── eval-okay-concatmap.nix │ │ │ ├── eval-okay-hashstring.nix │ │ │ ├── parse-fail-dup-attrs-3.nix │ │ │ ├── eval-okay-tojson.exp │ │ │ ├── eval-okay-attrs4.nix │ │ │ ├── eval-okay-builtins-add.nix │ │ │ ├── eval-okay-functionargs.exp │ │ │ ├── eval-okay-new-let.nix │ │ │ ├── eval-okay-types.exp │ │ │ ├── eval-okay-readFileType.nix │ │ │ ├── eval-fail-foldlStrict-strict-op-application.nix │ │ │ ├── eval-okay-groupBy.exp │ │ │ ├── eval-fail-hashfile-missing.nix │ │ │ ├── eval-okay-concatstringssep.nix │ │ │ ├── eval-okay-sort.exp │ │ │ ├── eval-okay-foldlStrict-lazy-elements.nix │ │ │ ├── eval-okay-with.nix │ │ │ ├── eval-okay-attrs2.nix │ │ │ ├── eval-okay-fromjson-escapes.exp │ │ │ ├── eval-okay-pathexists.nix │ │ │ ├── README.md │ │ │ ├── eval-okay-builtins.nix │ │ │ ├── eval-fail-path-slash.nix │ │ │ ├── eval-okay-any-all.nix │ │ │ ├── eval-okay-xml.nix │ │ │ ├── parse-okay-crlf.nix │ │ │ └── eval-okay-toxml2.exp │ │ ├── tvix_tests │ │ │ ├── eval-okay-fib.exp │ │ │ ├── eval-okay-seq.exp │ │ │ ├── identity-float.nix │ │ │ ├── identity-int.nix │ │ │ ├── identity-null.nix │ │ │ ├── directory │ │ │ │ └── default.nix │ │ │ ├── eval-okay-ceil.exp │ │ │ ├── eval-okay-deepseq.exp │ │ │ ├── eval-okay-eq-float.exp │ │ │ ├── eval-okay-eq-int.exp │ │ │ ├── eval-okay-floor.exp │ │ │ ├── eval-okay-lazy-assert.exp │ │ │ ├── eval-okay-lazy-with.exp │ │ │ ├── eval-okay-legacy-let.exp │ │ │ ├── eval-okay-let-inherit.exp │ │ │ ├── eval-okay-manual-rec.exp │ │ │ ├── eval-okay-ne-int.exp │ │ │ ├── eval-okay-ne-string.exp │ │ │ ├── eval-okay-nested-let.exp │ │ │ ├── eval-okay-nested-with.exp │ │ │ ├── eval-okay-or-operator.exp │ │ │ ├── eval-okay-remove.exp │ │ │ ├── eval-okay-simple-let.exp │ │ │ ├── eval-okay-simple-with.exp │ │ │ ├── eval-okay-thunked-if.exp │ │ │ ├── identity-bool-true.nix │ │ │ ├── identity-empty-attrs.nix │ │ │ ├── identity-empty-list.nix │ │ │ ├── identity-signed-int.nix │ │ │ ├── eval-okay-closure-self.exp │ │ │ ├── eval-okay-deferred-with.exp │ │ │ ├── eval-okay-eq-float.nix │ │ │ ├── eval-okay-eq-int.nix │ │ │ ├── eval-okay-eq-nested-list.exp │ │ │ ├── eval-okay-float-repr.exp │ │ │ ├── eval-okay-functor-call.exp │ │ │ ├── eval-okay-import.exp │ │ │ ├── eval-okay-internal-formals.exp │ │ │ ├── eval-okay-lambda-identity.exp │ │ │ ├── eval-okay-late-binding.exp │ │ │ ├── eval-okay-lazy-with-nested.exp │ │ │ ├── eval-okay-listtoattrs.exp │ │ │ ├── eval-okay-ne-int.nix │ │ │ ├── eval-okay-nested-closure.exp │ │ │ ├── eval-okay-nested-poisoning.exp │ │ │ ├── eval-okay-nested-thunks.exp │ │ │ ├── eval-okay-nix-version-cmp.exp │ │ │ ├── eval-okay-parsedrvname.exp │ │ │ ├── eval-okay-pathexists.exp │ │ │ ├── eval-okay-simple-closure.exp │ │ │ ├── eval-okay-thunked-functor.exp │ │ │ ├── eval-okay-thunked-with.exp │ │ │ ├── eval-okay-toxml-empty.nix │ │ │ ├── eval-okay-with-closure.exp │ │ │ ├── identity-bool-false.nix │ │ │ ├── identity-signed-float.nix │ │ │ ├── identity-string.nix │ │ │ ├── eval-okay-attr-key-catchable.exp │ │ │ ├── eval-okay-attrs-inherit-literal.exp │ │ │ ├── eval-okay-builtins-builtins.exp │ │ │ ├── eval-okay-closure-with-shadowing.exp │ │ │ ├── eval-okay-concat-lists.exp │ │ │ ├── eval-okay-elem.exp │ │ │ ├── eval-okay-empty-rec-inherit.exp │ │ │ ├── eval-okay-genlist.exp │ │ │ ├── eval-okay-hasattr-catchable.exp │ │ │ ├── eval-okay-import-display.exp │ │ │ ├── eval-okay-inherit-string-ident.exp │ │ │ ├── eval-okay-late-binding-closure.exp │ │ │ ├── eval-okay-legacy-let-in-with.exp │ │ │ ├── eval-okay-let-sibling-access.exp │ │ │ ├── eval-okay-list-comparison.exp │ │ │ ├── eval-okay-nested-assertions.exp │ │ │ ├── eval-okay-nested-set-thunks.exp │ │ │ ├── eval-okay-or-operator-default.exp │ │ │ ├── eval-okay-or-operator-nested.exp │ │ │ ├── eval-okay-useless-inherit-with.exp │ │ │ ├── eval-okay-with-in-dynamic-key.exp │ │ │ ├── eval-okay-with-in-list.exp │ │ │ ├── eval-fail-division-by-zero-int.nix │ │ │ ├── eval-okay-access-strange-identifier.exp │ │ │ ├── eval-okay-assert-thunk-condition.exp │ │ │ ├── eval-okay-builtins-head.exp │ │ │ ├── eval-okay-builtins-length.exp │ │ │ ├── eval-okay-builtins-mul.exp │ │ │ ├── eval-okay-builtins-tail.exp │ │ │ ├── eval-okay-catchable-double-throw.exp │ │ │ ├── eval-okay-catchable-in-attrNames.exp │ │ │ ├── eval-okay-catchable-in-inequality.exp │ │ │ ├── eval-okay-ceil.nix │ │ │ ├── eval-okay-concat-strings.exp │ │ │ ├── eval-okay-concatmap.exp │ │ │ ├── eval-okay-contains-nested-non-set.exp │ │ │ ├── eval-okay-foldlStrict-lazy-elements.exp │ │ │ ├── eval-okay-internal-formals-deferred.exp │ │ │ ├── eval-okay-let-identifiers.exp │ │ │ ├── eval-okay-let-useful-plain-inherit.exp │ │ │ ├── eval-okay-logical-and-catchable.exp │ │ │ ├── eval-okay-logical-or-catchable.exp │ │ │ ├── eval-okay-ne-string.nix │ │ │ ├── eval-okay-nested-deferred-upvalue.exp │ │ │ ├── eval-okay-or-operator-nested-default.exp │ │ │ ├── eval-okay-or-operator.nix │ │ │ ├── eval-okay-poisoned-scopes.exp │ │ │ ├── eval-okay-simple-interpol.exp │ │ │ ├── eval-okay-simple-recursive-attrs.exp │ │ │ ├── eval-okay-value-pointer-compare.exp │ │ │ ├── identity-dollar-escape.nix │ │ │ ├── eval-fail-division-by-zero-float.nix │ │ │ ├── eval-fail-infinite-recursion.nix │ │ │ ├── eval-fail-seq.nix │ │ │ ├── eval-okay-abort-throw-can-be-caught.exp │ │ │ ├── eval-okay-attempt-to-call-catchable.exp │ │ │ ├── eval-okay-attrs-eq.exp │ │ │ ├── eval-okay-attrs-simple-inherit.exp │ │ │ ├── eval-okay-builtins-bitor.exp │ │ │ ├── eval-okay-builtins-elemAt-catchable.exp │ │ │ ├── eval-okay-builtins-filter-catchable.exp │ │ │ ├── eval-okay-builtins-getAttr-catchable.exp │ │ │ ├── eval-okay-builtins-length-catchable.exp │ │ │ ├── eval-okay-builtins-substring-coerce.exp │ │ │ ├── eval-okay-catchable-in-intersectattrs.exp │ │ │ ├── eval-okay-catchable-in-update-attrs.exp │ │ │ ├── eval-okay-compare-ordering-catchable.exp │ │ │ ├── eval-okay-concat-lists.nix │ │ │ ├── eval-okay-concat-strings.nix │ │ │ ├── eval-okay-deeply-nested-with.exp │ │ │ ├── eval-okay-empty-rec-inherit.nix │ │ │ ├── eval-okay-escapify-integer-keys.exp │ │ │ ├── eval-okay-escapify-integer-keys.nix │ │ │ ├── eval-okay-fix.exp │ │ │ ├── eval-okay-floor.nix │ │ │ ├── eval-okay-foldlStrict.exp │ │ │ ├── eval-okay-let-inherit-from-later-bound.exp │ │ │ ├── eval-okay-multiline-string.exp │ │ │ ├── eval-okay-nested-let-slots.exp │ │ │ ├── eval-okay-observe-infinite-attrs.exp │ │ │ ├── eval-okay-or-operator-non-set.exp │ │ │ ├── eval-okay-path-exists-child-of-file.exp │ │ │ ├── eval-okay-recursive-attrs-all-features.exp │ │ │ ├── eval-okay-repeated-list-to-attrs.exp │ │ │ ├── eval-okay-simple-closure.nix │ │ │ ├── eval-okay-simple-interpol.nix │ │ │ ├── eval-okay-simple-nested-attrs.nix │ │ │ ├── identity-nested-attrs.nix │ │ │ ├── identity-quoted-attrname-if.nix │ │ │ ├── identity-quoted-attrname-in.nix │ │ │ ├── observable-eval-cache2.nix │ │ │ ├── eval-okay-attrs-update-empty-lhs.exp │ │ │ ├── eval-okay-attrs-update-empty-rhs.exp │ │ │ ├── eval-okay-attrs-update.exp │ │ │ ├── eval-okay-basenameof-propagate-catchables.exp │ │ │ ├── eval-okay-builtins-attrvalues.exp │ │ │ ├── eval-okay-builtins-bitand.exp │ │ │ ├── eval-okay-builtins-bitxor.exp │ │ │ ├── eval-okay-builtins-catAttrs.exp │ │ │ ├── eval-okay-builtins-elemat.exp │ │ │ ├── eval-okay-builtins-splitversion-catchable.exp │ │ │ ├── eval-okay-builtins-tojson-thunks.exp │ │ │ ├── eval-okay-builtins-tojson-tostring.exp │ │ │ ├── eval-okay-catchable-in-string-interpolation.exp │ │ │ ├── eval-okay-closure-pointer-compare.exp │ │ │ ├── eval-okay-deeply-nested-with-closure.exp │ │ │ ├── eval-okay-deferred-unary-formals.exp │ │ │ ├── eval-okay-foldlStrict-lazy-initial-accumulator.exp │ │ │ ├── eval-okay-genlist.nix │ │ │ ├── eval-okay-intersectattrs.exp │ │ │ ├── eval-okay-legacy-let-fix.exp │ │ │ ├── eval-okay-multiline-string.nix │ │ │ ├── eval-okay-nested-keys-let.exp │ │ │ ├── eval-okay-or-operator-default.nix │ │ │ ├── eval-okay-substring-propagate-catchables.exp │ │ │ ├── eval-okay-test-catchables-in-default-args.exp │ │ │ ├── eval-okay-test-catchables-in-implications.exp │ │ │ ├── identity-homogeneous-float-list.nix │ │ │ ├── identity-kv-attrs.nix │ │ │ ├── identity-quoted-attrname-else.nix │ │ │ ├── identity-quoted-attrname-let.nix │ │ │ ├── identity-quoted-attrname-rec.nix │ │ │ ├── identity-quoted-attrname-then.nix │ │ │ ├── identity-quoted-attrname-with.nix │ │ │ ├── eval-fail-closed-formals.nix │ │ │ ├── eval-fail-deep-forced-thunk-error.nix │ │ │ ├── eval-okay-attrs-update-empty-lhs.nix │ │ │ ├── eval-okay-attrs-update-empty-rhs.nix │ │ │ ├── eval-okay-attrs-update.nix │ │ │ ├── eval-okay-builtins-add.exp │ │ │ ├── eval-okay-builtins-from-json-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-match-propagate-catchables.exp │ │ │ ├── eval-okay-builtins-string-length.exp │ │ │ ├── eval-okay-builtins-sub.exp │ │ │ ├── eval-okay-contains-non-set.exp │ │ │ ├── eval-okay-lazy-equality.exp │ │ │ ├── eval-okay-let-useful-plain-inherit-mixed.exp │ │ │ ├── eval-okay-or-operator-nested.nix │ │ │ ├── eval-okay-rec-nested-access.exp │ │ │ ├── eval-okay-simple-nested-attrs.exp │ │ │ ├── eval-okay-toplevel-finaliser.exp │ │ │ ├── eval-okay-unpoison-scope.exp │ │ │ ├── identity-heterogeneous-list.nix │ │ │ ├── identity-homogeneous-int-list.nix │ │ │ ├── identity-homogeneous-string-list.nix │ │ │ ├── identity-quoted-attrname-assert.nix │ │ │ ├── identity-quoted-attrname-inherit.nix │ │ │ ├── eval-fail-deepseq.nix │ │ │ ├── eval-okay-basenameof.exp │ │ │ ├── eval-okay-builtins-attrvalues-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-getContext-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-hasContext-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-head-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-parse-drv-name-propagate-catchable.exp │ │ │ ├── eval-okay-catchable-passed-to-function-with-formals.exp │ │ │ ├── eval-okay-deeply-nested-attrs.nix │ │ │ ├── eval-okay-dirof.exp │ │ │ ├── eval-okay-eq-nested-list.nix │ │ │ ├── eval-okay-equality-tolerate-catchable-in-type-field.exp │ │ │ ├── eval-okay-legacy-let-in-with.nix │ │ │ ├── eval-okay-merge-nested-attrs.exp │ │ │ ├── eval-okay-multiple-nested-attrs.nix │ │ │ ├── eval-okay-nested-siblings.exp │ │ │ ├── eval-okay-or-operator-nested-default.nix │ │ │ ├── eval-okay-thunked-string-interpolation.exp │ │ │ ├── identity-flat-attrs.nix │ │ │ ├── observable-eval-cache1.nix │ │ │ ├── observable-eval-cache3.nix │ │ │ ├── eval-fail-builtins-thunk-error.nix │ │ │ ├── eval-okay-builtins-all-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-any-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-catattrs-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-getattr.exp │ │ │ ├── eval-okay-builtins-map-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-replaceStrings.exp │ │ │ ├── eval-okay-builtins-split-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-string-length-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-to-path-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-tojson-outpath-nested.exp │ │ │ ├── eval-okay-formals-miscompilation-b-261-regression.exp │ │ │ ├── eval-okay-legacy-let.nix │ │ │ ├── eval-okay-list-comparison.nix │ │ │ ├── eval-okay-merge-nested-rec-attrs.exp │ │ │ ├── eval-okay-nested-closure.nix │ │ │ ├── eval-okay-observable-eval-cache.exp │ │ │ ├── eval-okay-readfile.nix │ │ │ ├── eval-okay-arithmetic-int.exp │ │ │ ├── eval-okay-builtins-builtins.nix │ │ │ ├── eval-okay-builtins-filter-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-function-args-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-gen-list-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-genList-function-strictness.exp │ │ │ ├── eval-okay-builtins-group-by-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-hasattr.exp │ │ │ ├── eval-okay-builtins-tail-propagate-catchable.exp │ │ │ ├── eval-okay-escape-string-correct-char-boundaries.exp │ │ │ ├── eval-okay-functor-call.nix │ │ │ ├── eval-okay-late-binding.nix │ │ │ ├── eval-okay-mutually-recursive-let-binding.exp │ │ │ ├── eval-okay-nested-keys-rec.exp │ │ │ ├── eval-okay-overlapping-nested-attrs.exp │ │ │ ├── eval-okay-readfile.exp │ │ │ ├── eval-okay-rec-dynamic-keys.exp │ │ │ ├── eval-okay-simple-let.nix │ │ │ ├── eval-fail-parsedrvname-coerce.nix │ │ │ ├── eval-okay-attrs-simple-inherit.nix │ │ │ ├── eval-okay-attrs-update-kv-lhs.exp │ │ │ ├── eval-okay-builtins-concat-lists-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-concat-map-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-partition-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-sort-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-type-of-propagate-catchable.exp │ │ │ ├── eval-okay-concatmap.nix │ │ │ ├── eval-okay-concatstringssep.exp │ │ │ ├── eval-okay-multiple-nested-attrs.exp │ │ │ ├── eval-okay-optimised-bools.exp │ │ │ ├── eval-okay-path-exists-child-of-file.nix │ │ │ ├── eval-okay-add-paths.exp │ │ │ ├── eval-okay-attempt-to-call-catchable.nix │ │ │ ├── eval-okay-builtins-all.exp │ │ │ ├── eval-okay-builtins-any.exp │ │ │ ├── eval-okay-builtins-concat-strings-sep-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-filter.exp │ │ │ ├── eval-okay-builtins-groupby-thunk.exp │ │ │ ├── eval-okay-builtins-mapAttrs-function-strictness.exp │ │ │ ├── eval-okay-builtins-remove-attrs-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-substring-negative-length.exp │ │ │ ├── eval-okay-builtins-to-string-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-unsafe-discard-string-context-propagate-catchable.exp │ │ │ ├── eval-okay-catchable-in-inequality.nix │ │ │ ├── eval-okay-deepseq.nix │ │ │ ├── eval-okay-hasattr-catchable.nix │ │ │ ├── eval-okay-nested-set-thunks.nix │ │ │ ├── eval-okay-overlapping-nested-attrs.nix │ │ │ ├── eval-okay-rec-nested-access.nix │ │ │ ├── eval-okay-simple-recursive-attrs.nix │ │ │ ├── eval-okay-attrs-update-kv-lhs.nix │ │ │ ├── eval-okay-builtins-foldl-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-list-to-attrs-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-to-json-propagate-catchable.exp │ │ │ ├── eval-okay-catchable-in-update-attrs.nix │ │ │ ├── eval-okay-compare-ordering-catchable.nix │ │ │ ├── eval-okay-import-display.nix │ │ │ ├── eval-okay-late-binding-closure.nix │ │ │ ├── eval-okay-nested-keys-rec.nix │ │ │ ├── eval-fail-getEnv-coercion.nix │ │ │ ├── eval-okay-arithmetic-float.exp │ │ │ ├── eval-okay-builtins-genericClosure-propagate-catchable.exp │ │ │ ├── eval-okay-coerce-opadd.exp │ │ │ ├── eval-okay-float-repr.nix │ │ │ ├── eval-okay-let-sibling-access.nix │ │ │ ├── eval-okay-nested-keys-let.nix │ │ │ ├── eval-okay-nested-poisoning.nix │ │ │ ├── eval-okay-simple-with.nix │ │ │ ├── eval-okay-attr-key-catchable.nix │ │ │ ├── eval-okay-builtins-concat-lists.exp │ │ │ ├── eval-okay-builtins-to-xml-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-tojson-outpath.exp │ │ │ ├── eval-okay-cmp-float-true.exp │ │ │ ├── eval-okay-cmp-int-true.exp │ │ │ ├── eval-okay-cmp-num-true.exp │ │ │ ├── eval-okay-cmp-str-true.exp │ │ │ ├── eval-okay-import.nix │ │ │ ├── eval-okay-lambda-identity.nix │ │ │ ├── eval-okay-logical-and-catchable.nix │ │ │ ├── eval-okay-logical-or-catchable.nix │ │ │ ├── eval-okay-nested-assertions.nix │ │ │ ├── eval-okay-pathexists.nix │ │ │ ├── eval-okay-builtins-elemAt-catchable.nix │ │ │ ├── eval-okay-builtins-head.nix │ │ │ ├── eval-okay-builtins-length-catchable.nix │ │ │ ├── eval-okay-builtins-map.exp │ │ │ ├── eval-okay-builtins-tail.nix │ │ │ ├── eval-okay-catchable-double-throw.nix │ │ │ ├── eval-okay-catchable-in-attrNames.nix │ │ │ ├── eval-okay-cmp-int-false.exp │ │ │ ├── eval-okay-cmp-num-false.exp │ │ │ ├── eval-okay-cmp-str-false.exp │ │ │ ├── eval-okay-let-identifiers.nix │ │ │ ├── eval-okay-nested-has-attrs.exp │ │ │ ├── eval-okay-abort-throw-can-be-caught.nix │ │ │ ├── eval-okay-builtins-filter-catchable.nix │ │ │ ├── eval-okay-builtins-genericClosure-pointer-equality.exp │ │ │ ├── eval-okay-builtins-getAttr-catchable.nix │ │ │ ├── eval-okay-builtins-isType-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-lessThan.exp │ │ │ ├── eval-okay-catchable-in-string-interpolation.nix │ │ │ ├── eval-okay-cmp-float-false.exp │ │ │ ├── eval-okay-deeply-nested-attrs.exp │ │ │ ├── eval-fail-throw-abort-cannot-be-caught.nix │ │ │ ├── eval-okay-basenameof-propagate-catchables.nix │ │ │ ├── eval-okay-builtins-match-propagate-catchables.nix │ │ │ ├── eval-okay-builtins-splitversion-catchable.nix │ │ │ ├── eval-okay-catchable-in-intersectattrs.nix │ │ │ ├── eval-okay-poisoned-scopes.nix │ │ │ ├── eval-okay-substring-propagate-catchables.nix │ │ │ ├── eval-okay-toxml.nix │ │ │ ├── eval-okay-tryeval-thunk-twice.exp │ │ │ ├── notyetpassing │ │ │ │ ├── eval-okay-builtins-set-pointer-equality.exp │ │ │ │ ├── eval-okay-non-identifier-pointer-inequality.exp │ │ │ │ ├── eval-okay-cycle-display-cppnix-2.13.exp │ │ │ │ └── eval-fail-builtins-genericClosure-uncomparable-keys.nix │ │ │ ├── eval-fail-force-before-value-pointer-equality.nix │ │ │ ├── eval-fail-remove.nix │ │ │ ├── eval-okay-arithmetic-int.nix │ │ │ ├── eval-okay-builtins-div.exp │ │ │ ├── eval-okay-builtins-groupby-thunk.nix │ │ │ ├── eval-okay-builtins-map-function-strictness.exp │ │ │ ├── eval-okay-builtins-replace-strings-propagate-catchable.exp │ │ │ ├── eval-okay-builtins-thunked-function-calls.exp │ │ │ ├── eval-okay-catchable-passed-to-function-with-formals.nix │ │ │ ├── eval-okay-compare-lists.exp │ │ │ ├── eval-okay-intersectattrs.nix │ │ │ ├── eval-okay-nested-with.nix │ │ │ ├── eval-okay-remove.nix │ │ │ ├── eval-okay-test-catchables-in-implications.nix │ │ │ ├── eval-okay-tryeval-thunk-twice.nix │ │ │ ├── eval-okay-builtins-attrvalues-propagate-catchable.nix │ │ │ ├── eval-okay-builtins-from-json-propagate-catchable.nix │ │ │ ├── eval-okay-builtins-getContext-propagate-catchable.nix │ │ │ ├── eval-okay-builtins-hasContext-propagate-catchable.nix │ │ │ ├── eval-okay-builtins-substring.exp │ │ │ ├── eval-okay-builtins-tojson-literals.exp │ │ │ ├── eval-okay-rec-dynamic-keys.nix │ │ │ ├── eval-okay-seq.nix │ │ │ ├── eval-okay-test-catchables-in-default-args.nix │ │ │ ├── eval-okay-toxml-empty.exp.xml │ │ │ ├── eval-okay-attrs-inherit-literal.nix │ │ │ ├── eval-okay-builtins-compareVersions.exp │ │ │ ├── eval-okay-builtins-type-of.exp │ │ │ ├── eval-okay-lazy-assert.nix │ │ │ ├── eval-okay-nested-siblings.nix │ │ │ ├── eval-okay-builtins-attrvalues.nix │ │ │ ├── eval-okay-builtins-parse-drv-name-propagate-catchable.nix │ │ │ ├── eval-okay-merge-nested-attrs.nix │ │ │ ├── eval-okay-thunked-if.nix │ │ │ ├── eval-okay-value-pointer-equality.exp │ │ │ ├── eval-okay-arithmetic-float.nix │ │ │ ├── eval-okay-builtins-length.nix │ │ │ ├── eval-okay-contains-nested-non-set.nix │ │ │ ├── eval-okay-legacy-let-fix.nix │ │ │ ├── eval-okay-let-useful-plain-inherit.nix │ │ │ ├── eval-okay-or-operator-non-set.nix │ │ │ ├── eval-okay-value-display.exp │ │ │ ├── eval-okay-fix.nix │ │ │ ├── eval-fail-function-formals-typecheck.nix │ │ │ ├── eval-okay-cmp-int-false.nix │ │ │ ├── eval-okay-cmp-int-true.nix │ │ │ ├── eval-okay-nested-let.nix │ │ │ ├── eval-okay-thunked-functor.nix │ │ │ ├── eval-okay-deeply-nested-with.nix │ │ │ ├── eval-okay-equality-tolerate-catchable-in-type-field.nix │ │ │ ├── eval-okay-builtins-substring-coerce.nix │ │ │ ├── eval-okay-cmp-num-false.nix │ │ │ ├── eval-okay-elem.nix │ │ │ ├── eval-okay-with-closure.nix │ │ │ ├── eval-okay-closure-self.nix │ │ │ ├── eval-okay-cmp-num-true.nix │ │ │ ├── eval-okay-internal-formals.nix │ │ │ ├── eval-okay-thunked-with.nix │ │ │ ├── eval-okay-builtins-tojson-thunks.nix │ │ │ ├── eval-okay-cmp-float-false.nix │ │ │ ├── eval-okay-cmp-float-true.nix │ │ │ ├── eval-okay-fib.nix │ │ │ ├── eval-okay-foldlStrict-lazy-initial-accumulator.nix │ │ │ ├── eval-okay-builtins-attrnames.exp │ │ │ ├── eval-okay-builtins-genericClosure-propagate-catchable.nix │ │ │ ├── eval-okay-builtins-elemat.nix │ │ │ ├── eval-okay-builtins-head-propagate-catchable.nix │ │ │ ├── eval-okay-builtins-mul.nix │ │ │ ├── eval-okay-nested-thunks.nix │ │ │ ├── eval-okay-regex-match.exp │ │ │ ├── eval-okay-value-pointer-compare.nix │ │ │ ├── eval-fail-builtins-tojson-tostring-notcallable.nix │ │ │ ├── eval-okay-builtins-genList-function-strictness.nix │ │ │ ├── eval-okay-builtins-catattrs-propagate-catchable.nix │ │ │ ├── eval-okay-builtins-type-predicates.exp │ │ │ ├── eval-okay-inherit-string-ident.nix │ │ │ ├── eval-okay-lazy-with.nix │ │ │ ├── eval-fail-foldlStrict-strict-op-application.nix │ │ │ ├── eval-okay-builtins-mapAttrs-function-strictness.nix │ │ │ ├── eval-okay-contains-non-set.nix │ │ │ ├── eval-okay-tryeval.exp │ │ │ ├── eval-okay-builtins-string-length-propagate-catchable.nix │ │ │ ├── eval-okay-cmp-str-false.nix │ │ │ ├── eval-okay-cmp-str-true.nix │ │ │ ├── eval-okay-foldlStrict-lazy-elements.nix │ │ │ ├── eval-okay-internal-formals-deferred.nix │ │ │ ├── eval-okay-let-inherit.nix │ │ │ ├── eval-okay-nested-deferred-upvalue.nix │ │ │ ├── eval-okay-builtins-function-args-propagate-catchable.nix │ │ │ ├── eval-okay-builtins-split-propagate-catchable.nix │ │ │ ├── eval-okay-recursive-attrs-all-features.nix │ │ │ ├── eval-okay-thunked-string-interpolation.nix │ │ │ ├── eval-okay-xml.nix │ │ │ ├── eval-fail-builtins-substring-negative-start.nix │ │ │ ├── eval-okay-builtins-hashString.nix │ │ │ ├── eval-okay-deferred-with.nix │ │ │ ├── eval-okay-lazy-with-nested.nix │ │ │ ├── eval-okay-let-inherit-from-later-bound.nix │ │ │ ├── eval-okay-builtins-substring-negative-length.nix │ │ │ ├── eval-okay-functionargs.exp │ │ │ ├── eval-okay-unpoison-scope.nix │ │ │ ├── eval-okay-builtins-add.nix │ │ │ ├── eval-okay-builtins-all-propagate-catchable.nix │ │ │ ├── eval-okay-builtins-any-propagate-catchable.nix │ │ │ ├── eval-okay-builtins-partition.exp │ │ │ ├── eval-okay-builtins-sub.nix │ │ │ ├── eval-okay-builtins-to-path-propagate-catchable.nix │ │ │ ├── eval-okay-builtins-tojson-outpath-nested.nix │ │ │ ├── eval-okay-foldlStrict.nix │ │ │ ├── eval-okay-mutually-recursive-let-binding.nix │ │ │ ├── eval-okay-builtins-tojson-outpath.nix │ │ │ ├── eval-okay-builtins-unsafe-discard-string-context-propagate-catchable.nix │ │ │ ├── eval-okay-coerce-opadd.nix │ │ │ ├── eval-okay-deferred-unary-formals.nix │ │ │ ├── eval-okay-manual-rec.nix │ │ │ ├── eval-fail-builtins-tojson-tostring-strong.nix │ │ │ ├── eval-okay-builtins-filter-propagate-catchable.nix │ │ │ ├── eval-okay-builtins-map-function-strictness.nix │ │ │ ├── eval-okay-builtins-toString.exp │ │ │ ├── eval-okay-builtins-tojson-literals.nix │ │ │ ├── eval-okay-observe-infinite-attrs.nix │ │ │ ├── eval-okay-toplevel-finaliser.nix │ │ │ ├── eval-okay-tryeval.nix │ │ │ ├── eval-okay-assert-thunk-condition.nix │ │ │ ├── eval-okay-builtins-concat-map-propagate-catchable.nix │ │ │ ├── eval-okay-builtins-map-propagate-catchable.nix │ │ │ ├── eval-fail-outer-value-never-pointer-equal.nix │ │ │ ├── eval-okay-builtins-concat-lists-propagate-catchable.nix │ │ │ ├── eval-okay-builtins-gen-list-propagate-catchable.nix │ │ │ ├── eval-okay-stable-sort.nix │ │ │ ├── eval-okay-toxml.exp │ │ │ ├── eval-okay-access-strange-identifier.nix │ │ │ ├── eval-okay-builtins-concat-lists.nix │ │ │ ├── eval-okay-builtins-group-by-propagate-catchable.nix │ │ │ ├── eval-okay-builtins-catAttrs.nix │ │ │ ├── eval-okay-builtins-concat-strings-sep-propagate-catchable.nix │ │ │ ├── eval-okay-builtins-partition-propagate-catchable.nix │ │ │ ├── eval-okay-add-paths.nix │ │ │ ├── eval-okay-concatstringssep.nix │ │ │ ├── eval-okay-builtins-getattr.nix │ │ │ ├── eval-okay-builtins-replaceStrings.nix │ │ │ ├── eval-okay-builtins-to-string-propagate-catchable.nix │ │ │ ├── eval-okay-builtins-tojson-tostring.nix │ │ │ ├── eval-okay-dirof.nix │ │ │ ├── eval-okay-fromjson-escapes.exp │ │ │ ├── eval-okay-nix-version-cmp.nix │ │ │ ├── eval-okay-builtins-tail-propagate-catchable.nix │ │ │ ├── eval-okay-builtins-hashString.exp │ │ │ ├── eval-okay-builtins-type-of-propagate-catchable.nix │ │ │ └── eval-okay-builtins-sort-propagate-catchable.nix │ │ └── mod.rs │ └── test_utils.rs ├── builtin-macros │ └── .gitignore ├── .skip-subtree └── clippy.toml ├── docs ├── .gitignore ├── src │ └── eval │ │ └── abandoned │ │ └── index.md └── mdbook-extra.css ├── logo.webp ├── serde ├── .skip-subtree ├── Cargo.toml └── src │ └── lib.rs ├── .gitignore ├── OWNERS ├── nix-compat ├── testdata │ └── narinfo.zst ├── src │ ├── nar │ │ ├── mod.rs │ │ ├── tests │ │ │ ├── helloworld.nar │ │ │ └── symlink.nar │ │ └── writer │ │ │ └── mod.rs │ ├── nix_daemon │ │ └── framing │ │ │ └── mod.rs │ ├── wire │ │ ├── ser │ │ │ └── display.rs │ │ └── mod.rs │ ├── derivation │ │ └── tests │ │ │ └── derivation_tests │ │ │ └── ok │ │ │ ├── m1vfixn8iprlf0v9abmlrz7mjw1xj8kp-cp1252.drv │ │ │ ├── x6p0hg79i3wg0kkv7699935f7rrj9jf3-latin1.drv │ │ │ ├── m1vfixn8iprlf0v9abmlrz7mjw1xj8kp-cp1252.drv.json │ │ │ └── x6p0hg79i3wg0kkv7699935f7rrj9jf3-latin1.drv.json │ ├── aterm │ │ └── mod.rs │ └── nixcpp │ │ └── mod.rs └── build.rs ├── simstore └── test-data │ └── q.txt ├── .vscode └── extensions.json ├── nix-compat-derive-tests └── tests │ ├── ui.rs │ └── ui │ ├── parse_mising_version.stderr │ ├── deserialize_from_missing.rs │ ├── deserialize_from_str_missing.rs │ ├── parse_bad_nix.stderr │ ├── deserialize_try_from_missing.rs │ ├── parse_bad_default_path.stderr │ ├── parse_bad_nix.rs │ ├── parse_bad_default.stderr │ ├── parse_bad_version.stderr │ ├── parse_bad_default.rs │ ├── parse_bad_version.rs │ ├── parse_mising_version.rs │ ├── parse_bad_default_path.rs │ ├── deserialize_bad_type.rs │ ├── deserialize_remote_missing_attr.stderr │ ├── deserialize_from_missing.stderr │ └── deserialize_missing_default.rs └── workspace.josh /cli/tests/.skip-tree: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /crate-hashes.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /glue/src/tests/dummy/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /glue/src/tests/empty-file: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/data: -------------------------------------------------------------------------------- 1 | foo 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/readDir/bar: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /eval/builtin-macros/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/dir1/a.nix: -------------------------------------------------------------------------------- 1 | "a" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/dir2/a.nix: -------------------------------------------------------------------------------- 1 | "X" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/dir2/b.nix: -------------------------------------------------------------------------------- 1 | "b" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/dir3/a.nix: -------------------------------------------------------------------------------- 1 | "X" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/dir3/b.nix: -------------------------------------------------------------------------------- 1 | "X" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/dir3/c.nix: -------------------------------------------------------------------------------- 1 | "c" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/dir4/a.nix: -------------------------------------------------------------------------------- 1 | "X" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/dir4/c.nix: -------------------------------------------------------------------------------- 1 | "X" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-hash.exp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/readDir/ldir: -------------------------------------------------------------------------------- 1 | foo -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-if.exp: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-seq.exp: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /cli/tests/import.nix: -------------------------------------------------------------------------------- 1 | {}: import ./six.nix { } 2 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | book 2 | .mdbook-plantuml-cache/ 3 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-attrs.exp: -------------------------------------------------------------------------------- 1 | 987 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-attrs2.exp: -------------------------------------------------------------------------------- 1 | 987 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-eq.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-logic.exp: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-remove.exp: -------------------------------------------------------------------------------- 1 | 456 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-scope-1.exp: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-scope-2.exp: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-scope-3.exp: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-scope-7.exp: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/imported2.nix: -------------------------------------------------------------------------------- 1 | range 6 10 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-fib.exp: -------------------------------------------------------------------------------- 1 | 89 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-seq.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-float.nix: -------------------------------------------------------------------------------- 1 | 4.2 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-int.nix: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-null.nix: -------------------------------------------------------------------------------- 1 | null 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-arithmetic.exp: -------------------------------------------------------------------------------- 1 | 2216 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-builtins.exp: -------------------------------------------------------------------------------- 1 | /foo 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-deepseq.exp: -------------------------------------------------------------------------------- 1 | 456 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-empty-args.exp: -------------------------------------------------------------------------------- 1 | "ab" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-fromjson.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-getenv.exp: -------------------------------------------------------------------------------- 1 | "foobar" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-let.exp: -------------------------------------------------------------------------------- 1 | "foobar" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-nested-with.exp: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-pathexists.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-scope-4.exp: -------------------------------------------------------------------------------- 1 | "ccdd" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-scope-6.exp: -------------------------------------------------------------------------------- 1 | "ccdd" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-versions.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-fail-uft8.nix: -------------------------------------------------------------------------------- 1 | 123 é 4 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-fail-undef-var.nix: -------------------------------------------------------------------------------- 1 | x: y 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/readDir/foo/git-hates-directories: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/directory/default.nix: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-ceil.exp: -------------------------------------------------------------------------------- 1 | [ 4 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-deepseq.exp: -------------------------------------------------------------------------------- 1 | 456 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-eq-float.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-eq-int.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-floor.exp: -------------------------------------------------------------------------------- 1 | [ 3 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-lazy-assert.exp: -------------------------------------------------------------------------------- 1 | 12 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-lazy-with.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-legacy-let.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-let-inherit.exp: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-manual-rec.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-ne-int.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-ne-string.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-let.exp: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-with.exp: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-or-operator.exp: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-remove.exp: -------------------------------------------------------------------------------- 1 | 456 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-simple-let.exp: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-simple-with.exp: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-thunked-if.exp: -------------------------------------------------------------------------------- 1 | { } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-bool-true.nix: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-empty-attrs.nix: -------------------------------------------------------------------------------- 1 | { } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-empty-list.nix: -------------------------------------------------------------------------------- 1 | [ ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-signed-int.nix: -------------------------------------------------------------------------------- 1 | -42 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-callable-attrs.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-catattrs.exp: -------------------------------------------------------------------------------- 1 | [ 1 2 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-dynamic-attrs-2.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-flatten.exp: -------------------------------------------------------------------------------- 1 | "1234567" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-foldlStrict.exp: -------------------------------------------------------------------------------- 1 | 500500 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-list.exp: -------------------------------------------------------------------------------- 1 | "foobarblatest" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-listtoattrs.exp: -------------------------------------------------------------------------------- 1 | "AAbar" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-regex-match.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-regex-split.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-seq.nix: -------------------------------------------------------------------------------- 1 | builtins.seq 1 2 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-tail-call-1.exp: -------------------------------------------------------------------------------- 1 | 100000 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-fail-dup-formals.nix: -------------------------------------------------------------------------------- 1 | {x, y, x}: x -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-closure-self.exp: -------------------------------------------------------------------------------- 1 | "done" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-deferred-with.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-eq-float.nix: -------------------------------------------------------------------------------- 1 | 4.2 == 4.2 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-eq-int.nix: -------------------------------------------------------------------------------- 1 | 42 == 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-eq-nested-list.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-float-repr.exp: -------------------------------------------------------------------------------- 1 | 1.23457 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-functor-call.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-import.exp: -------------------------------------------------------------------------------- 1 | [ 42 42 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-internal-formals.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-lambda-identity.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-late-binding.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-lazy-with-nested.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-listtoattrs.exp: -------------------------------------------------------------------------------- 1 | "AAbar" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-ne-int.nix: -------------------------------------------------------------------------------- 1 | 42 != 69 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-closure.exp: -------------------------------------------------------------------------------- 1 | 16 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-poisoning.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-thunks.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nix-version-cmp.exp: -------------------------------------------------------------------------------- 1 | -1 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-parsedrvname.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-pathexists.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-simple-closure.exp: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-thunked-functor.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-thunked-with.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-toxml-empty.nix: -------------------------------------------------------------------------------- 1 | { } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-with-closure.exp: -------------------------------------------------------------------------------- 1 | 150 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-bool-false.nix: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-signed-float.nix: -------------------------------------------------------------------------------- 1 | -4.2 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-string.nix: -------------------------------------------------------------------------------- 1 | "test string" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-fail-bad-antiquote-1.nix: -------------------------------------------------------------------------------- 1 | "${x: x}" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-attrnames.exp: -------------------------------------------------------------------------------- 1 | "newxfoonewxy" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-elem.exp: -------------------------------------------------------------------------------- 1 | [ true false 30 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-float.exp: -------------------------------------------------------------------------------- 1 | [ 3.4 3.5 2.5 1.5 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-new-let.exp: -------------------------------------------------------------------------------- 1 | "xyzzyfoobar" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-null-dynamic-attrs.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-redefine-builtin.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-regression-20220122.exp: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-regression-20220125.exp: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-with.exp: -------------------------------------------------------------------------------- 1 | "xyzzybarxyzzybar" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-overrides.exp: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-okay-1.nix: -------------------------------------------------------------------------------- 1 | {x, y, z}: x + y + z 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/readDir/linked: -------------------------------------------------------------------------------- 1 | foo/git-hates-directories -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-attr-key-catchable.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-attrs-inherit-literal.exp: -------------------------------------------------------------------------------- 1 | 15 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-builtins.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-closure-with-shadowing.exp: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-concat-lists.exp: -------------------------------------------------------------------------------- 1 | [ 1 2 3 4 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-elem.exp: -------------------------------------------------------------------------------- 1 | [ true false 30 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-empty-rec-inherit.exp: -------------------------------------------------------------------------------- 1 | { } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-genlist.exp: -------------------------------------------------------------------------------- 1 | [ 0 1 4 9 16 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-hasattr-catchable.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-import-display.exp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-inherit-string-ident.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-late-binding-closure.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-legacy-let-in-with.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-let-sibling-access.exp: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-list-comparison.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-assertions.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-set-thunks.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-or-operator-default.exp: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-or-operator-nested.exp: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-useless-inherit-with.exp: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-with-in-dynamic-key.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-with-in-list.exp: -------------------------------------------------------------------------------- 1 | [ 1 2 3 ] 2 | -------------------------------------------------------------------------------- /glue/src/.skip-subtree: -------------------------------------------------------------------------------- 1 | Because of the derivation.nix file ... 2 | -------------------------------------------------------------------------------- /logo.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvlfyi/tvix/HEAD/logo.webp -------------------------------------------------------------------------------- /serde/.skip-subtree: -------------------------------------------------------------------------------- 1 | The foods.nix can not be read by readTree. 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-fail-bad-antiquote-3.nix: -------------------------------------------------------------------------------- 1 | ''${x: x}'' 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-attrs3.exp: -------------------------------------------------------------------------------- 1 | "foo 22 80 itchyxac" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-backslash-newline-1.exp: -------------------------------------------------------------------------------- 1 | "a\nb" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-backslash-newline-1.nix: -------------------------------------------------------------------------------- 1 | "a\ 2 | b" 3 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-backslash-newline-2.exp: -------------------------------------------------------------------------------- 1 | "a\nb" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-concat.exp: -------------------------------------------------------------------------------- 1 | [ 1 2 3 4 5 6 7 8 9 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-elements.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-map.exp: -------------------------------------------------------------------------------- 1 | "foobarblabarxyzzybar" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-patterns.exp: -------------------------------------------------------------------------------- 1 | "abcxyzDDDDEFijk" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-splitversion.exp: -------------------------------------------------------------------------------- 1 | [ "1" "2" "3" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-strings-as-attrs-names.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-fail-division-by-zero-int.nix: -------------------------------------------------------------------------------- 1 | 1 / 0 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-access-strange-identifier.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-assert-thunk-condition.exp: -------------------------------------------------------------------------------- 1 | 21 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-head.exp: -------------------------------------------------------------------------------- 1 | [ "foo" 1 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-length.exp: -------------------------------------------------------------------------------- 1 | [ 0 1 3 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-mul.exp: -------------------------------------------------------------------------------- 1 | [ 36 0 0 14 42 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-tail.exp: -------------------------------------------------------------------------------- 1 | [ [ ] [ 2 3 ] ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-catchable-double-throw.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-catchable-in-attrNames.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-catchable-in-inequality.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-ceil.nix: -------------------------------------------------------------------------------- 1 | [ (builtins.ceil 3.4) ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-concat-strings.exp: -------------------------------------------------------------------------------- 1 | "hello world" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-concatmap.exp: -------------------------------------------------------------------------------- 1 | [ "a" "z" "b" "z" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-contains-nested-non-set.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-foldlStrict-lazy-elements.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-internal-formals-deferred.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-let-identifiers.exp: -------------------------------------------------------------------------------- 1 | [ 1 2 3 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-let-useful-plain-inherit.exp: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-logical-and-catchable.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-logical-or-catchable.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-ne-string.nix: -------------------------------------------------------------------------------- 1 | "this" != "that" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-deferred-upvalue.exp: -------------------------------------------------------------------------------- 1 | 20 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-or-operator-nested-default.exp: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-or-operator.nix: -------------------------------------------------------------------------------- 1 | { a = 1; }.a or 2 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-poisoned-scopes.exp: -------------------------------------------------------------------------------- 1 | [ 1 2 3 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-simple-interpol.exp: -------------------------------------------------------------------------------- 1 | "hello world" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-simple-recursive-attrs.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-value-pointer-compare.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-dollar-escape.nix: -------------------------------------------------------------------------------- 1 | "\${foobar}" 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /result-* 3 | /result 4 | target 5 | 6 | /*.sled 7 | -------------------------------------------------------------------------------- /cli/tests/six.nix: -------------------------------------------------------------------------------- 1 | {}: { six = builtins.foldl' (x: y: x + y) 0 [ 1 2 3 ]; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-fail-seq.nix: -------------------------------------------------------------------------------- 1 | builtins.seq (abort "foo") 2 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-fail-to-path.nix: -------------------------------------------------------------------------------- 1 | builtins.toPath "foo/bar" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-backslash-newline-2.nix: -------------------------------------------------------------------------------- 1 | ''a''\ 2 | b'' 3 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-delayed-with-inherit.exp: -------------------------------------------------------------------------------- 1 | "b-overridden" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-readDir.nix: -------------------------------------------------------------------------------- 1 | builtins.readDir ./readDir 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-substring.exp: -------------------------------------------------------------------------------- 1 | "ooxfoobarybarzobaabbc" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-curpos.exp: -------------------------------------------------------------------------------- 1 | [ 3 7 4 9 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.exp: -------------------------------------------------------------------------------- 1 | "abccX" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-fail-patterns-1.nix: -------------------------------------------------------------------------------- 1 | args@{args, x, y, z}: x 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-fail-division-by-zero-float.nix: -------------------------------------------------------------------------------- 1 | 1.0 / 0.0 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-fail-infinite-recursion.nix: -------------------------------------------------------------------------------- 1 | let x = x; in x 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-fail-seq.nix: -------------------------------------------------------------------------------- 1 | builtins.seq (abort "foo") 2 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-abort-throw-can-be-caught.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-attrs-eq.exp: -------------------------------------------------------------------------------- 1 | [ true true true false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-attrs-simple-inherit.exp: -------------------------------------------------------------------------------- 1 | { a = 1; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-bitor.exp: -------------------------------------------------------------------------------- 1 | [ 0 1 1 1 8 8 8 8 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-elemAt-catchable.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-filter-catchable.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-getAttr-catchable.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-length-catchable.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-substring-coerce.exp: -------------------------------------------------------------------------------- 1 | "42" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-catchable-in-intersectattrs.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-catchable-in-update-attrs.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-compare-ordering-catchable.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-concat-lists.nix: -------------------------------------------------------------------------------- 1 | [ 1 2 ] ++ [ 3 4 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-concat-strings.nix: -------------------------------------------------------------------------------- 1 | "hello " + "world" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-deeply-nested-with.exp: -------------------------------------------------------------------------------- 1 | [ 1 2 3 4 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-empty-rec-inherit.nix: -------------------------------------------------------------------------------- 1 | rec { inherit; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-escapify-integer-keys.exp: -------------------------------------------------------------------------------- 1 | { "3" = 3; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-escapify-integer-keys.nix: -------------------------------------------------------------------------------- 1 | { "3" = 3; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-fix.exp: -------------------------------------------------------------------------------- 1 | { a = 1; b = 21; c = 42; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-floor.nix: -------------------------------------------------------------------------------- 1 | [ (builtins.floor 3.4) ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-foldlStrict.exp: -------------------------------------------------------------------------------- 1 | [ 6 [ 0 1 2 3 ] 2 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-let-inherit-from-later-bound.exp: -------------------------------------------------------------------------------- 1 | 23 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-multiline-string.exp: -------------------------------------------------------------------------------- 1 | "hello\nworld" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-let-slots.exp: -------------------------------------------------------------------------------- 1 | [ 1 2 3 4 5 6 7 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-observe-infinite-attrs.exp: -------------------------------------------------------------------------------- 1 | [ "x" "y" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-or-operator-non-set.exp: -------------------------------------------------------------------------------- 1 | "works fine" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-path-exists-child-of-file.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-recursive-attrs-all-features.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-repeated-list-to-attrs.exp: -------------------------------------------------------------------------------- 1 | [ 1 2 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-simple-closure.nix: -------------------------------------------------------------------------------- 1 | (a: b: a + b) 2 5 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-simple-interpol.nix: -------------------------------------------------------------------------------- 1 | "hello ${"world"}" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-simple-nested-attrs.nix: -------------------------------------------------------------------------------- 1 | { a.b = 42; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-nested-attrs.nix: -------------------------------------------------------------------------------- 1 | { a = { b = null; }; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-quoted-attrname-if.nix: -------------------------------------------------------------------------------- 1 | { "if" = true; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-quoted-attrname-in.nix: -------------------------------------------------------------------------------- 1 | { "in" = true; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/observable-eval-cache2.nix: -------------------------------------------------------------------------------- 1 | observable-eval-cache1.nix -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-comments.exp: -------------------------------------------------------------------------------- 1 | "abcdefghijklmnopqrstuvwxyz" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-concat.nix: -------------------------------------------------------------------------------- 1 | [1 2 3] ++ [4 5 6] ++ [7 8 9] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-initial-accumulator.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-mapattrs.exp: -------------------------------------------------------------------------------- 1 | { x = "x-foo"; y = "y-bar"; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-floor-ceil.exp: -------------------------------------------------------------------------------- 1 | "23;24;23;23" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-undefined.exp: -------------------------------------------------------------------------------- 1 | null 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-attrs-update-empty-lhs.exp: -------------------------------------------------------------------------------- 1 | { a = "ok"; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-attrs-update-empty-rhs.exp: -------------------------------------------------------------------------------- 1 | { a = "ok"; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-attrs-update.exp: -------------------------------------------------------------------------------- 1 | { a = 15; b = "works"; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-attrvalues.exp: -------------------------------------------------------------------------------- 1 | [ [ ] [ 2 3 1 ] ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-bitand.exp: -------------------------------------------------------------------------------- 1 | [ 0 0 0 1 8 8 8 8 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-bitxor.exp: -------------------------------------------------------------------------------- 1 | [ 0 1 1 0 8 8 0 0 0 0 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-catAttrs.exp: -------------------------------------------------------------------------------- 1 | [ 21 "+" 21 "=" 42 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-elemat.exp: -------------------------------------------------------------------------------- 1 | [ "foo" "bar" "baz" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-splitversion-catchable.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-tojson-thunks.exp: -------------------------------------------------------------------------------- 1 | "[42,42,\"42\"]" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-tojson-tostring.exp: -------------------------------------------------------------------------------- 1 | "\"it's 42\"" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-catchable-in-string-interpolation.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-closure-pointer-compare.exp: -------------------------------------------------------------------------------- 1 | [ false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-deeply-nested-with-closure.exp: -------------------------------------------------------------------------------- 1 | [ 1 2 3 4 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-deferred-unary-formals.exp: -------------------------------------------------------------------------------- 1 | [ false -2 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-foldlStrict-lazy-initial-accumulator.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-genlist.nix: -------------------------------------------------------------------------------- 1 | builtins.genList (x: x * x) 5 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-intersectattrs.exp: -------------------------------------------------------------------------------- 1 | { a = 100; b = 200; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-legacy-let-fix.exp: -------------------------------------------------------------------------------- 1 | { one = 42; two = 42; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-multiline-string.nix: -------------------------------------------------------------------------------- 1 | ''hello 2 | world'' 3 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-keys-let.exp: -------------------------------------------------------------------------------- 1 | { a = { b = 42; }; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-or-operator-default.nix: -------------------------------------------------------------------------------- 1 | { b = 1; }.b or 2 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-substring-propagate-catchables.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-test-catchables-in-default-args.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-test-catchables-in-implications.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-homogeneous-float-list.nix: -------------------------------------------------------------------------------- 1 | [ 4.2 6.9 13.37 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-kv-attrs.nix: -------------------------------------------------------------------------------- 1 | { name = "foo"; value = 12; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-quoted-attrname-else.nix: -------------------------------------------------------------------------------- 1 | { "else" = true; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-quoted-attrname-let.nix: -------------------------------------------------------------------------------- 1 | { "let" = true; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-quoted-attrname-rec.nix: -------------------------------------------------------------------------------- 1 | { "rec" = true; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-quoted-attrname-then.nix: -------------------------------------------------------------------------------- 1 | { "then" = true; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-quoted-attrname-with.nix: -------------------------------------------------------------------------------- 1 | { "with" = true; } 2 | -------------------------------------------------------------------------------- /glue/src/tests/nix_tests/eval-okay-context.exp: -------------------------------------------------------------------------------- 1 | "foo eval-okay-context.nix bar" 2 | -------------------------------------------------------------------------------- /OWNERS: -------------------------------------------------------------------------------- 1 | set noparent 2 | 3 | adisbladis 4 | flokli 5 | aspen 6 | sterni 7 | tazjin 8 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-builtins-add.exp: -------------------------------------------------------------------------------- 1 | [ 5 4 "int" "tt" "float" 4 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-null-dynamic-attrs.nix: -------------------------------------------------------------------------------- 1 | { ${null} = true; } == {} 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-regression-20220122.nix: -------------------------------------------------------------------------------- 1 | ((_: _) 1) + ((__: __) 2) 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-splitversion.nix: -------------------------------------------------------------------------------- 1 | builtins.splitVersion "1.2.3" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-fail-bad-antiquote-2.nix: -------------------------------------------------------------------------------- 1 | "${./fnord}" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.exp: -------------------------------------------------------------------------------- 1 | "xyzzy!xyzzy!foobar" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-import.exp: -------------------------------------------------------------------------------- 1 | [ 1 2 3 4 5 6 7 8 9 10 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-fail-closed-formals.nix: -------------------------------------------------------------------------------- 1 | ({ x }: x) { x = 1; y = 2; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-fail-deep-forced-thunk-error.nix: -------------------------------------------------------------------------------- 1 | [ (throw "error!") ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-attrs-update-empty-lhs.nix: -------------------------------------------------------------------------------- 1 | { } // { a = "ok"; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-attrs-update-empty-rhs.nix: -------------------------------------------------------------------------------- 1 | { a = "ok"; } // { } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-attrs-update.nix: -------------------------------------------------------------------------------- 1 | { a = 15; } // { b = "works"; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-add.exp: -------------------------------------------------------------------------------- 1 | [ 18 18.9 18.9 19.1 19 42 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-from-json-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-match-propagate-catchables.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-string-length.exp: -------------------------------------------------------------------------------- 1 | [ 3 "hello" 9 4 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-sub.exp: -------------------------------------------------------------------------------- 1 | [ -4 -3.1 -4.9 -4.7 -4 42 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-contains-non-set.exp: -------------------------------------------------------------------------------- 1 | [ false false false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-lazy-equality.exp: -------------------------------------------------------------------------------- 1 | [ true true false true true ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-let-useful-plain-inherit-mixed.exp: -------------------------------------------------------------------------------- 1 | [ 1 2 3 4 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-or-operator-nested.nix: -------------------------------------------------------------------------------- 1 | { a.b = 1; }.a.b or 2 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-rec-nested-access.exp: -------------------------------------------------------------------------------- 1 | { a = { b = 1; c = 2; }; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-simple-nested-attrs.exp: -------------------------------------------------------------------------------- 1 | { a = { b = 42; }; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-toplevel-finaliser.exp: -------------------------------------------------------------------------------- 1 | { a = 1; b = 2; c = 3; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-unpoison-scope.exp: -------------------------------------------------------------------------------- 1 | [ true false null 1 2 3 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-heterogeneous-list.nix: -------------------------------------------------------------------------------- 1 | [ 1 2.1 "three" null ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-homogeneous-int-list.nix: -------------------------------------------------------------------------------- 1 | [ 0 1 2 3 4 5 7 8 9 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-homogeneous-string-list.nix: -------------------------------------------------------------------------------- 1 | [ "string" "list" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-quoted-attrname-assert.nix: -------------------------------------------------------------------------------- 1 | { "assert" = true; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-quoted-attrname-inherit.nix: -------------------------------------------------------------------------------- 1 | { "inherit" = true; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-fail-abort.nix: -------------------------------------------------------------------------------- 1 | if true then abort "this should fail" else 1 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-fail-deepseq.nix: -------------------------------------------------------------------------------- 1 | builtins.deepSeq { x = abort "foo"; } 456 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-concatmap.exp: -------------------------------------------------------------------------------- 1 | [ [ 1 3 5 7 9 ] [ "a" "z" "b" "z" ] ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-filter.exp: -------------------------------------------------------------------------------- 1 | [ 0 2 4 6 8 10 100 102 104 106 108 110 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-logic.nix: -------------------------------------------------------------------------------- 1 | assert !false && (true || false) -> true; 1 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-fail-deepseq.nix: -------------------------------------------------------------------------------- 1 | builtins.deepSeq { x = abort "foo"; } 456 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-basenameof.exp: -------------------------------------------------------------------------------- 1 | [ "bar" "foo" "" "bar" "." "" "" "" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-attrvalues-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-getContext-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-hasContext-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-head-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-parse-drv-name-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-catchable-passed-to-function-with-formals.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-deeply-nested-attrs.nix: -------------------------------------------------------------------------------- 1 | { a.b.c.d.e.f.g = "deep!"; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-dirof.exp: -------------------------------------------------------------------------------- 1 | [ /foo "." "foo//" "foo" "." "." / "/" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-eq-nested-list.nix: -------------------------------------------------------------------------------- 1 | [ [ "f" "" ] ] == [ [ "f" "" ] ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-equality-tolerate-catchable-in-type-field.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-legacy-let-in-with.nix: -------------------------------------------------------------------------------- 1 | with { }; let { body = 42; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-merge-nested-attrs.exp: -------------------------------------------------------------------------------- 1 | { set = { a = 1; b = 2; }; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-multiple-nested-attrs.nix: -------------------------------------------------------------------------------- 1 | { a.b = 15; b.c = "test"; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-siblings.exp: -------------------------------------------------------------------------------- 1 | { outer = 42; sibling = 42; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-or-operator-nested-default.nix: -------------------------------------------------------------------------------- 1 | { a.b = 1; }.a.c or 2 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-thunked-string-interpolation.exp: -------------------------------------------------------------------------------- 1 | "strict literal" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/identity-flat-attrs.nix: -------------------------------------------------------------------------------- 1 | { a = 15; b = "string"; c = null; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/observable-eval-cache1.nix: -------------------------------------------------------------------------------- 1 | let id = x: x; in { inherit id; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/observable-eval-cache3.nix: -------------------------------------------------------------------------------- 1 | let id = x: x; in { inherit id; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-fail-substring.nix: -------------------------------------------------------------------------------- 1 | builtins.substring (builtins.sub 0 1) 1 "x" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-any-all.exp: -------------------------------------------------------------------------------- 1 | [ false false true true true true false true ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-attrs4.exp: -------------------------------------------------------------------------------- 1 | [ true false true false false true false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-attrs5.exp: -------------------------------------------------------------------------------- 1 | [ 123 "foo" 456 456 "foo" "xyzzy" "xyzzy" true ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-nested-with.nix: -------------------------------------------------------------------------------- 1 | with { x = 1; }; 2 | with { x = 2; }; 3 | x 4 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-readfile.exp: -------------------------------------------------------------------------------- 1 | "builtins.readFile ./eval-okay-readfile.nix\n" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-readfile.nix: -------------------------------------------------------------------------------- 1 | builtins.readFile ./eval-okay-readfile.nix 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-context.exp: -------------------------------------------------------------------------------- 1 | "foo eval-okay-context.nix bar" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-eq-derivations.exp: -------------------------------------------------------------------------------- 1 | [ true true true false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-fail-builtins-thunk-error.nix: -------------------------------------------------------------------------------- 1 | builtins.genList (_: { }.foo) 1 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-all-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-any-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-catattrs-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-getattr.exp: -------------------------------------------------------------------------------- 1 | [ 1 2 3 { bar = { baz = 3; }; } ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-map-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ true false true ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-replaceStrings.exp: -------------------------------------------------------------------------------- 1 | [ "fabir" "a" "1a1" "ABC" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-split-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-string-length-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-to-path-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-tojson-outpath-nested.exp: -------------------------------------------------------------------------------- 1 | "{\"a\":40,\"b\":2}" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-formals-miscompilation-b-261-regression.exp: -------------------------------------------------------------------------------- 1 | [ true null ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-legacy-let.nix: -------------------------------------------------------------------------------- 1 | let { 2 | a = 21; 3 | body = a * 2; 4 | } 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-list-comparison.nix: -------------------------------------------------------------------------------- 1 | [ 1 2 ] > [ ((rec{ x = 1; }).x) 2 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-merge-nested-rec-attrs.exp: -------------------------------------------------------------------------------- 1 | { set = { a = 21; b = 42; }; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-closure.nix: -------------------------------------------------------------------------------- 1 | (a: b: c: d: a + b + c + d) 1 3 5 7 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-observable-eval-cache.exp: -------------------------------------------------------------------------------- 1 | [ true true false false true ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-readfile.nix: -------------------------------------------------------------------------------- 1 | builtins.readFile ./eval-okay-readfile.nix 2 | -------------------------------------------------------------------------------- /glue/src/tests/nix_tests/eval-okay-context-introspection.exp: -------------------------------------------------------------------------------- 1 | [ true true true true true true ] 2 | -------------------------------------------------------------------------------- /glue/src/tests/tvix_tests/eval-fail-fetchurl-invalid-url.nix: -------------------------------------------------------------------------------- 1 | (builtins.fetchurl /dev/null) 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-fail-missing-arg.nix: -------------------------------------------------------------------------------- 1 | ({x, y, z}: x + y + z) {x = "foo"; z = "bar";} 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-empty-args.nix: -------------------------------------------------------------------------------- 1 | ({}: {x,y,}: "${x}${y}") {} {x = "a"; y = "b";} 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-if.nix: -------------------------------------------------------------------------------- 1 | if "foo" != "f" + "oo" then 1 else if false then 2 else 3 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-path.exp: -------------------------------------------------------------------------------- 1 | "/nix/store/ya937r4ydw0l6kayq8jkyqaips9c75jm-output" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-delayed-with.exp: -------------------------------------------------------------------------------- 1 | "b-overridden b-overridden a" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-fail-dup-attrs-1.nix: -------------------------------------------------------------------------------- 1 | { x = 123; 2 | y = 456; 3 | x = 789; 4 | } 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-arithmetic-int.exp: -------------------------------------------------------------------------------- 1 | { add = 20; div = 3; mul = 8; sub = 15; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-builtins.nix: -------------------------------------------------------------------------------- 1 | [ builtins ] == [ builtins.builtins ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-filter-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-function-args-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ true false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-gen-list-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ true false true ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-genList-function-strictness.exp: -------------------------------------------------------------------------------- 1 | [ 0 1 2 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-group-by-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-hasattr.exp: -------------------------------------------------------------------------------- 1 | [ true true true false false true false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-tail-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false true true true ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-escape-string-correct-char-boundaries.exp: -------------------------------------------------------------------------------- 1 | "💭(\":thonking:\")" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-functor-call.nix: -------------------------------------------------------------------------------- 1 | { x = 21; __functor = self: y: self.x * y; } 2 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-late-binding.nix: -------------------------------------------------------------------------------- 1 | let 2 | a = b; 3 | b = 42; 4 | in 5 | a 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-mutually-recursive-let-binding.exp: -------------------------------------------------------------------------------- 1 | { a = 1; b = 2; c = 3; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-keys-rec.exp: -------------------------------------------------------------------------------- 1 | { a = { b = { c = 42; }; }; outer = 21; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-overlapping-nested-attrs.exp: -------------------------------------------------------------------------------- 1 | { a = { b = 15; c = "test"; }; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-readfile.exp: -------------------------------------------------------------------------------- 1 | "builtins.readFile ./eval-okay-readfile.nix\n" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-rec-dynamic-keys.exp: -------------------------------------------------------------------------------- 1 | { barbaz = 42; foobar = 42; val = 21; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-simple-let.nix: -------------------------------------------------------------------------------- 1 | let 2 | a = 1; 3 | b = 2; 4 | in 5 | a + b 6 | -------------------------------------------------------------------------------- /glue/src/tests/blob.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvlfyi/tvix/HEAD/glue/src/tests/blob.tar.bz2 -------------------------------------------------------------------------------- /glue/src/tests/blob.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvlfyi/tvix/HEAD/glue/src/tests/blob.tar.gz -------------------------------------------------------------------------------- /glue/src/tests/blob.tar.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvlfyi/tvix/HEAD/glue/src/tests/blob.tar.xz -------------------------------------------------------------------------------- /glue/src/tests/tvix_tests/eval-fail-fetchtarball-invalid-url.nix: -------------------------------------------------------------------------------- 1 | (builtins.fetchTarball /dev/null) 2 | -------------------------------------------------------------------------------- /glue/src/tests/tvix_tests/eval-okay-storePath.exp: -------------------------------------------------------------------------------- 1 | { contextMatches = true; hasContext = true; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-fail-blackhole.nix: -------------------------------------------------------------------------------- 1 | let { 2 | body = x; 3 | x = y; 4 | y = x; 5 | } 6 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-concatstringssep.exp: -------------------------------------------------------------------------------- 1 | [ "" "foobarxyzzy" "foo, bar, xyzzy" "foo" "" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-dynamic-attrs-2.nix: -------------------------------------------------------------------------------- 1 | { a."${"b"}" = true; a."${"c"}" = false; }.a.b 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-toxml2.nix: -------------------------------------------------------------------------------- 1 | builtins.toXML [("a" + "b") 10 (rec {x = "x"; y = x;})] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-fail-parsedrvname-coerce.nix: -------------------------------------------------------------------------------- 1 | builtins.parseDrvName { outPath = "lol"; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-attrs-simple-inherit.nix: -------------------------------------------------------------------------------- 1 | let 2 | a = 1; 3 | in 4 | { inherit a; } 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-attrs-update-kv-lhs.exp: -------------------------------------------------------------------------------- 1 | { name = "foo"; other = 42; value = "bar"; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-concat-lists-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false true ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-concat-map-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-partition-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-sort-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false true false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-type-of-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false true true false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-concatmap.nix: -------------------------------------------------------------------------------- 1 | (builtins.concatMap (x: [ x ] ++ [ "z" ]) [ "a" "b" ]) 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-concatstringssep.exp: -------------------------------------------------------------------------------- 1 | [ "" "foobarxyzzy" "foo, bar, xyzzy" "foo" "" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-multiple-nested-attrs.exp: -------------------------------------------------------------------------------- 1 | { a = { b = 15; }; b = { c = "test"; }; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-optimised-bools.exp: -------------------------------------------------------------------------------- 1 | [ true true false false true true false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-path-exists-child-of-file.nix: -------------------------------------------------------------------------------- 1 | builtins.pathExists ("/dev/null/.") 2 | -------------------------------------------------------------------------------- /eval/.skip-subtree: -------------------------------------------------------------------------------- 1 | Do not traverse further, readTree will encounter Nix language tests 2 | and such and fail. 3 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-catattrs.nix: -------------------------------------------------------------------------------- 1 | builtins.catAttrs "a" [ { a = 1; } { b = 0; } { a = 2; } ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-deepseq.nix: -------------------------------------------------------------------------------- 1 | builtins.deepSeq (let as = { x = 123; y = as; }; in as) 456 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-let.nix: -------------------------------------------------------------------------------- 1 | let { 2 | x = "foo"; 3 | y = "bar"; 4 | body = x + y; 5 | } 6 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-context-introspection.exp: -------------------------------------------------------------------------------- 1 | [ true true true true true true ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-search-path.flags: -------------------------------------------------------------------------------- 1 | -I lang/dir1 -I lang/dir2 -I dir5=lang/dir3 -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-add-paths.exp: -------------------------------------------------------------------------------- 1 | [ /bin /binbar /binbar /binbar /binbar /bin/bar /bin/bin ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-attempt-to-call-catchable.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (throw "fred" 5)).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-all.exp: -------------------------------------------------------------------------------- 1 | [ true true false false false false true true false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-any.exp: -------------------------------------------------------------------------------- 1 | [ false true false true true true false true false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-concat-strings-sep-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-filter.exp: -------------------------------------------------------------------------------- 1 | [ [ 1 2 3 4 5 ] [ ] [ 2 2 2 ] [ [ 1 2 ] [ 3 4 ] ] ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-groupby-thunk.exp: -------------------------------------------------------------------------------- 1 | { fred = [ { x = "fred"; y = "fred"; } ]; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-mapAttrs-function-strictness.exp: -------------------------------------------------------------------------------- 1 | { a = 1; b = 2; f = ; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-remove-attrs-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false true false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-substring-negative-length.exp: -------------------------------------------------------------------------------- 1 | [ "SIP dial" "Lounge" " Lounge" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-to-string-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-unsafe-discard-string-context-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-catchable-in-inequality.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (throw "bob" != 3)).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-deepseq.nix: -------------------------------------------------------------------------------- 1 | builtins.deepSeq (let as = { x = 123; y = as; }; in as) 456 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-hasattr-catchable.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval ((throw "fred") ? bob)).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-set-thunks.nix: -------------------------------------------------------------------------------- 1 | ({ 2 | x = { 3 | y = 42; 4 | }; 5 | }).x.y 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-overlapping-nested-attrs.nix: -------------------------------------------------------------------------------- 1 | { 2 | a.b = 15; 3 | a.c = "test"; 4 | } 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-rec-nested-access.nix: -------------------------------------------------------------------------------- 1 | rec { 2 | a.b = 1; 3 | a.c = a.b * 2; 4 | } 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-simple-recursive-attrs.nix: -------------------------------------------------------------------------------- 1 | (rec { 2 | a = 21; 3 | b = a * 2; 4 | }).b 5 | -------------------------------------------------------------------------------- /nix-compat/testdata/narinfo.zst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvlfyi/tvix/HEAD/nix-compat/testdata/narinfo.zst -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-fail-mixed-nested-attrs1.nix: -------------------------------------------------------------------------------- 1 | { 2 | x.z = 3; 3 | x = { y = 3; z = 3; }; 4 | } 5 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-okay-regression-751.nix: -------------------------------------------------------------------------------- 1 | let const = a: "const"; in 2 | ''${ const { x = "q"; }}'' 3 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-attrs-update-kv-lhs.nix: -------------------------------------------------------------------------------- 1 | { name = "foo"; value = "bar"; } // { other = 42; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-foldl-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false false false true true ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-list-to-attrs-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false true true false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-to-json-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false false false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-catchable-in-update-attrs.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (throw "bob" // { })).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-compare-ordering-catchable.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval ((throw "x") < 3)).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-import-display.nix: -------------------------------------------------------------------------------- 1 | # In C++ Nix 2.3 this used to be 2 | import 3 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-late-binding-closure.nix: -------------------------------------------------------------------------------- 1 | let 2 | f = n: n + a; 3 | a = 2; 4 | in 5 | f 40 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-keys-rec.nix: -------------------------------------------------------------------------------- 1 | rec { 2 | outer = 21; 3 | a.b.c = outer * 2; 4 | } 5 | -------------------------------------------------------------------------------- /nix-compat/src/nar/mod.rs: -------------------------------------------------------------------------------- 1 | pub(crate) mod wire; 2 | 3 | pub mod listing; 4 | pub mod reader; 5 | pub mod writer; 6 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-fail-assert.nix: -------------------------------------------------------------------------------- 1 | let { 2 | x = arg: assert arg == "y"; 123; 3 | 4 | body = x "x"; 5 | } -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-scope-1.nix: -------------------------------------------------------------------------------- 1 | (({x}: x: 2 | 3 | { x = 1; 4 | y = x; 5 | } 6 | ) {x = 2;} 3).y 7 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-scope-7.nix: -------------------------------------------------------------------------------- 1 | rec { 2 | inherit (x) y; 3 | x = { 4 | y = 1; 5 | }; 6 | }.y 7 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-tail-call-1.nix: -------------------------------------------------------------------------------- 1 | let 2 | f = n: if n == 100000 then n else f (n + 1); 3 | in f 0 4 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-fail-undeclared-arg.nix: -------------------------------------------------------------------------------- 1 | ({x, z}: x + z) {x = "foo"; y = "bla"; z = "bar";} 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-undefined.nix: -------------------------------------------------------------------------------- 1 | builtins.unsafeGetAttrPos "abort" builtins 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-fail-dup-attrs-4.nix: -------------------------------------------------------------------------------- 1 | { 2 | services.ssh.port = 22; 3 | services.ssh.port = 23; 4 | } 5 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-fail-mixed-nested-attrs2.nix: -------------------------------------------------------------------------------- 1 | { 2 | x.y.y = 3; 3 | x = { y.y= 3; z = 3; }; 4 | } 5 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-okay-mixed-nested-attrs-1.nix: -------------------------------------------------------------------------------- 1 | { 2 | x = { y = 3; z = 3; }; 3 | x.q = 3; 4 | } 5 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-okay-mixed-nested-attrs-2.nix: -------------------------------------------------------------------------------- 1 | { 2 | x.q = 3; 3 | x = { y = 3; z = 3; }; 4 | } 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-fail-getEnv-coercion.nix: -------------------------------------------------------------------------------- 1 | builtins.getEnv { var = "PATH"; __toString = self: self.var; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-arithmetic-float.exp: -------------------------------------------------------------------------------- 1 | { add = 37.34; div = 1.05714; mul = 105.154; sub = 14.35; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-genericClosure-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | { success = false; value = false; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-coerce-opadd.exp: -------------------------------------------------------------------------------- 1 | [ "lordnikon" "zerocool" /tmp/31337h4x0r "fooblah" "blahfoo" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-float-repr.nix: -------------------------------------------------------------------------------- 1 | # Floats are displayed with a maximum of 5 digits 2 | 1.23456789 3 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-let-sibling-access.nix: -------------------------------------------------------------------------------- 1 | let 2 | a = 1; 3 | b = 2; 4 | c = a + b; 5 | in 6 | c 7 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-keys-let.nix: -------------------------------------------------------------------------------- 1 | let 2 | inner = 21; 3 | set.a.b = inner * 2; 4 | in 5 | set 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-poisoning.nix: -------------------------------------------------------------------------------- 1 | let 2 | null = 1; 3 | f = n: n + null; 4 | in 5 | f 41 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-simple-with.nix: -------------------------------------------------------------------------------- 1 | let 2 | set = { 3 | a = 1; 4 | }; 5 | in 6 | with set; a 7 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-eq.nix: -------------------------------------------------------------------------------- 1 | ["foobar" (rec {x = 1; y = x;})] 2 | == 3 | [("foo" + "bar") ({x = 1; y = 1;})] 4 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-map.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | concat (map (x: x + "bar") [ "foo" "bla" "xyzzy" ]) -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-readDir.exp: -------------------------------------------------------------------------------- 1 | { bar = "regular"; foo = "directory"; ldir = "symlink"; linked = "symlink"; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-attrs6.exp: -------------------------------------------------------------------------------- 1 | { __overrides = { bar = "qux"; }; bar = "qux"; foo = "bar"; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos.exp: -------------------------------------------------------------------------------- 1 | { column = 5; file = "eval-okay-getattrpos.nix"; line = 3; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-attr-key-catchable.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval { "${builtins.throw "a"}" = "b"; }).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-concat-lists.exp: -------------------------------------------------------------------------------- 1 | [ [ ] [ 1 2 3 4 5 6 ] [ [ 1 ] [ 2 ] [ 3 ] ] [ 1 2 3 4 5 6 ] ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-to-xml-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false false false true false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-tojson-outpath.exp: -------------------------------------------------------------------------------- 1 | "\"/nix/store/jzka5ndnygkkfjfvpqwjipqp75lhz138-emacs-28.2\"" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-cmp-float-true.exp: -------------------------------------------------------------------------------- 1 | { eq = true; ge = true; gt = true; le = true; lt = true; ne = true; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-cmp-int-true.exp: -------------------------------------------------------------------------------- 1 | { eq = true; ge = true; gt = true; le = true; lt = true; ne = true; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-cmp-num-true.exp: -------------------------------------------------------------------------------- 1 | { eq = true; ge = true; gt = true; le = true; lt = true; ne = true; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-cmp-str-true.exp: -------------------------------------------------------------------------------- 1 | { eq = true; ge = true; gt = true; le = true; lt = true; ne = true; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-import.nix: -------------------------------------------------------------------------------- 1 | [ 2 | (import ./directory) 3 | (import ./directory/default.nix) 4 | ] 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-lambda-identity.nix: -------------------------------------------------------------------------------- 1 | # Identity function is the simplest possible function. 2 | (x: x) 42 3 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-logical-and-catchable.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval ((throw "fred") && (throw "jill"))).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-logical-or-catchable.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval ((throw "fred") || (throw "jill"))).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-assertions.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (assert (assert false; true); true)).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-pathexists.nix: -------------------------------------------------------------------------------- 1 | builtins.pathExists ./lib.nix 2 | && !builtins.pathExists ./bla.nix 3 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-foldlStrict.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | builtins.foldl' (x: y: x + y) 0 (range 1 1000) 4 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-readFileType.exp: -------------------------------------------------------------------------------- 1 | { bar = "regular"; foo = "directory"; ldir = "symlink"; linked = "symlink"; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-regression-20220125.nix: -------------------------------------------------------------------------------- 1 | ((__curPosFoo: __curPosFoo) 1) + ((__curPosBar: __curPosBar) 2) 2 | 3 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-scope-2.nix: -------------------------------------------------------------------------------- 1 | ((x: {x}: 2 | rec { 3 | x = 1; 4 | y = x; 5 | } 6 | ) 2 {x = 3;}).y 7 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-fromTOML-timestamps.flags: -------------------------------------------------------------------------------- 1 | --extra-experimental-features parse-toml-timestamps 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-elemAt-catchable.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (builtins.elemAt (throw "fred") 0)).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-head.nix: -------------------------------------------------------------------------------- 1 | [ 2 | (builtins.head [ "foo" ]) 3 | (builtins.head [ 1 2 3 ]) 4 | ] 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-length-catchable.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (builtins.length (throw "fred"))).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-map.exp: -------------------------------------------------------------------------------- 1 | [ [ 1 2 3 4 5 ] [ 2 4 6 8 10 ] [ 2 4 6 8 10 ] [ 2 4 6 8 10 ] [ 1 2 3 4 5 ] ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-tail.nix: -------------------------------------------------------------------------------- 1 | [ 2 | (builtins.tail [ "foo" ]) 3 | (builtins.tail [ 1 2 3 ]) 4 | ] 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-catchable-double-throw.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (builtins.throw (builtins.throw "a"))).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-catchable-in-attrNames.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (builtins.attrNames (throw "fred"))).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-cmp-int-false.exp: -------------------------------------------------------------------------------- 1 | { eq = false; ge = false; gt = false; le = false; lt = false; ne = false; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-cmp-num-false.exp: -------------------------------------------------------------------------------- 1 | { eq = false; ge = false; gt = false; le = false; lt = false; ne = false; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-cmp-str-false.exp: -------------------------------------------------------------------------------- 1 | { eq = false; ge = false; gt = false; le = false; lt = false; ne = false; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-let-identifiers.nix: -------------------------------------------------------------------------------- 1 | let 2 | a = 1; 3 | "b" = 2; 4 | ${"c"} = 3; 5 | in 6 | [ a b c ] 7 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-has-attrs.exp: -------------------------------------------------------------------------------- 1 | [ true true true true true true true false false false false false ] 2 | -------------------------------------------------------------------------------- /docs/src/eval/abandoned/index.md: -------------------------------------------------------------------------------- 1 | # Abandoned ideas 2 | 3 | This chapter keeps track of abandoned ideas, and why they were abandoned. 4 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-fail-remove.nix: -------------------------------------------------------------------------------- 1 | let { 2 | attrs = {x = 123; y = 456;}; 3 | 4 | body = (removeAttrs attrs ["x"]).x; 5 | } -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-callable-attrs.nix: -------------------------------------------------------------------------------- 1 | ({ __functor = self: x: self.foo && x; foo = false; } // { foo = true; }) true 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-redefine-builtin.nix: -------------------------------------------------------------------------------- 1 | let 2 | throw = abort "Error!"; 3 | in (builtins.tryEval ).success 4 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-remove.nix: -------------------------------------------------------------------------------- 1 | let { 2 | attrs = {x = 123; y = 456;}; 3 | 4 | body = (removeAttrs attrs ["x"]).y; 5 | } -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-autoargs.flags: -------------------------------------------------------------------------------- 1 | --arg lib import(nix_tests/lib.nix) --argstr xyzzy xyzzy! -A result 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-okay-dup-attrs-5.nix: -------------------------------------------------------------------------------- 1 | { 2 | services.ssh = { enable = true; }; 3 | services.ssh.port = 23; 4 | } 5 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-okay-dup-attrs-6.nix: -------------------------------------------------------------------------------- 1 | { 2 | services.ssh.port = 23; 3 | services.ssh = { enable = true; }; 4 | } 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-abort-throw-can-be-caught.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (builtins.abort (builtins.throw "abc"))).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-filter-catchable.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (builtins.filter (_: throw "fred") [ 3 ])).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-genericClosure-pointer-equality.exp: -------------------------------------------------------------------------------- 1 | [ { key = [ { foo = ; } ]; val = null; } ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-getAttr-catchable.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (builtins.getAttr (throw "fred") "bob")).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-isType-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false false false false false false false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-lessThan.exp: -------------------------------------------------------------------------------- 1 | [ true true true true false false false false true true true true false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-catchable-in-string-interpolation.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval ("${toString 3} ${throw "bob"}")).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-cmp-float-false.exp: -------------------------------------------------------------------------------- 1 | { eq = false; ge = false; gt = false; le = false; lt = false; ne = false; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-deeply-nested-attrs.exp: -------------------------------------------------------------------------------- 1 | { a = { b = { c = { d = { e = { f = { g = "deep!"; }; }; }; }; }; }; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-getenv.nix: -------------------------------------------------------------------------------- 1 | builtins.getEnv "TEST_VAR" + (if builtins.getEnv "NO_SUCH_VAR" == "" then "bar" else "bla") 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-attrs6.nix: -------------------------------------------------------------------------------- 1 | rec { 2 | "${"foo"}" = "bar"; 3 | __overrides = { bar = "qux"; }; 4 | } 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-fail-throw-abort-cannot-be-caught.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (builtins.throw (builtins.abort "abc"))).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (builtins.baseNameOf (throw "jill"))).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-match-propagate-catchables.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (builtins.match (throw "foo") ".*")).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-splitversion-catchable.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (builtins.splitVersion (throw "fred"))).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-catchable-in-intersectattrs.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (builtins.intersectAttrs (throw "fred") { })).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-poisoned-scopes.nix: -------------------------------------------------------------------------------- 1 | let 2 | true = 1; 3 | false = 2; 4 | null = 3; 5 | in 6 | [ true false null ] 7 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-substring-propagate-catchables.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (builtins.substring 0 4 (throw "jill"))).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-toxml.nix: -------------------------------------------------------------------------------- 1 | # Check some corner cases regarding escaping. 2 | builtins.toXML { a = "s"; "&-{" = ";&\""; } 3 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-tryeval-thunk-twice.exp: -------------------------------------------------------------------------------- 1 | [ { success = false; value = false; } { success = false; value = false; } ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/notyetpassing/eval-okay-builtins-set-pointer-equality.exp: -------------------------------------------------------------------------------- 1 | [ true true true true true true true true true true ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/notyetpassing/eval-okay-non-identifier-pointer-inequality.exp: -------------------------------------------------------------------------------- 1 | [ false false false false false true false false ] 2 | -------------------------------------------------------------------------------- /glue/src/tests/tvix_tests/eval-okay-context-introspection.exp: -------------------------------------------------------------------------------- 1 | [ true true true true true true true true true true true true true true ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-list.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | let { 4 | 5 | body = concat ["foo" "bar" "bla" "test"]; 6 | 7 | } -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-replacestrings.exp: -------------------------------------------------------------------------------- 1 | [ "faabar" "fbar" "fubar" "faboor" "fubar" "XaXbXcX" "X" "a_b" "fubar" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-fail-dup-attrs-7.nix: -------------------------------------------------------------------------------- 1 | rec { 2 | 3 | x = 1; 4 | 5 | as = { 6 | inherit x; 7 | inherit x; 8 | }; 9 | } -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-fail-force-before-value-pointer-equality.nix: -------------------------------------------------------------------------------- 1 | let 2 | x = throw "I have been forced"; 3 | in 4 | 5 | x == x 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-fail-remove.nix: -------------------------------------------------------------------------------- 1 | let { 2 | attrs = { x = 123; y = 456; }; 3 | 4 | body = (removeAttrs attrs [ "x" ]).x; 5 | } 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-arithmetic-int.nix: -------------------------------------------------------------------------------- 1 | { 2 | add = 15 + 5; 3 | sub = 20 - 5; 4 | mul = 4 * 2; 5 | div = 9 / 3; 6 | } 7 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-div.exp: -------------------------------------------------------------------------------- 1 | [ 3 7 0 1 0 0.5 0.5 0.5 42 1 1 -1 -1 -1 1 1 -1 -1 -1 1 1 -1 -1 -1 -74711 -74711 -74711 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-groupby-thunk.nix: -------------------------------------------------------------------------------- 1 | builtins.groupBy 2 | (v: v.x) 3 | [ (rec { y = x; x = "fred"; }) ] 4 | 5 | 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-map-function-strictness.exp: -------------------------------------------------------------------------------- 1 | [ 2 "." 18 "https://github.com/NixOS/nix/issues/9779" "-.-" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-replace-strings-propagate-catchable.exp: -------------------------------------------------------------------------------- 1 | [ false false false false false false false false false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-thunked-function-calls.exp: -------------------------------------------------------------------------------- 1 | [ 2 [ "Hans" "James" "Joachim" ] 2 [ "Clawdia" "Mynheer" ] 981 3 2 2 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-catchable-passed-to-function-with-formals.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (({ fred }: "bob") (throw "3"))).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-compare-lists.exp: -------------------------------------------------------------------------------- 1 | [ false true true true false true false false false true false false false true true ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-intersectattrs.nix: -------------------------------------------------------------------------------- 1 | builtins.intersectAttrs 2 | { a = 1; b = 2; c = 3; } 3 | { a = 100; b = 200; d = 5; } 4 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-with.nix: -------------------------------------------------------------------------------- 1 | let 2 | set1 = { a = 1; }; 3 | set2 = { a = 2; }; 4 | in 5 | with set1; with set2; a 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-remove.nix: -------------------------------------------------------------------------------- 1 | let { 2 | attrs = { x = 123; y = 456; }; 3 | 4 | body = (removeAttrs attrs [ "x" ]).y; 5 | } 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-test-catchables-in-implications.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (({ foo ? throw "up" }: foo -> true) { })).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-tryeval-thunk-twice.nix: -------------------------------------------------------------------------------- 1 | let x = throw "lol"; in builtins.map (f: f x) [ builtins.tryEval builtins.tryEval ] 2 | -------------------------------------------------------------------------------- /simstore/test-data/q.txt: -------------------------------------------------------------------------------- 1 | GP: Why do you deal with so many negatives? 2 | M2: To dissolve them. 3 | GP: Will you develop that point? 4 | M2: No. 5 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-partition.exp: -------------------------------------------------------------------------------- 1 | { right = [ 0 2 4 6 8 10 100 102 104 106 108 110 ]; wrong = [ 1 3 5 7 9 101 103 105 107 109 ]; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-scope-3.nix: -------------------------------------------------------------------------------- 1 | ((x: as: {x}: 2 | rec { 3 | inherit (as) x; 4 | y = x; 5 | } 6 | ) 2 {x = 4;} {x = 3;}).y 7 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-scope-6.nix: -------------------------------------------------------------------------------- 1 | let { 2 | 3 | f = {x ? y, y ? x}: x + y; 4 | 5 | body = f {x = "c";} + f {y = "d";}; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-attrvalues-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (builtins.attrValues (builtins.throw "a"))).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-from-json-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (builtins.fromJSON (builtins.throw "a"))).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-getContext-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (builtins.getContext (builtins.throw "a"))).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-hasContext-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (builtins.hasContext (builtins.throw "a"))).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-substring.exp: -------------------------------------------------------------------------------- 1 | [ "tes" "testing" "" "estin" "ting" "" "" "" "" "est" "est" "est" "est" "est" "est" "" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-tojson-literals.exp: -------------------------------------------------------------------------------- 1 | "[42,\"hello\",13.37,[],[1,2,3],{},{\"name\":\"foo\",\"value\":42},{\"foo\":42}]" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-rec-dynamic-keys.nix: -------------------------------------------------------------------------------- 1 | rec { 2 | val = 21; 3 | ${"foo" + "bar"} = 42; 4 | ${"bar" + "baz"} = val * 2; 5 | } 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-seq.nix: -------------------------------------------------------------------------------- 1 | (builtins.seq 1 2) + (builtins.seq [ (throw "list") ] 20) + (builtins.seq { boing = throw "set"; } 20) 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-test-catchables-in-default-args.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (({ foo ? throw "up" }: if foo then 1 else 2) { })).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-toxml-empty.exp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /glue/src/tests/tvix_tests/eval-okay-toxml-context.exp: -------------------------------------------------------------------------------- 1 | [ { "/nix/store/y1s2fiq89v2h9vkb38w508ir20dwv6v2-test.drv" = { allOutputs = true; }; } false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-string.exp: -------------------------------------------------------------------------------- 1 | "foobar/a/b/c/d/foo/xyzzy/foo.txt/../foo/x/yescape: \"quote\" \n \\end\nof\nlinefoobarblaatfoo$bar$\"$\"$" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-functionargs.exp: -------------------------------------------------------------------------------- 1 | { column = 11; file = "eval-okay-getattrpos-functionargs.nix"; line = 2; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-attrs-inherit-literal.nix: -------------------------------------------------------------------------------- 1 | # the 'from' part of an `inherit` can be any expression. 2 | { inherit ({ a = 15; }) a; }.a 3 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-compareVersions.exp: -------------------------------------------------------------------------------- 1 | [ 0 -1 -1 0 0 0 1 1 -1 1 -1 1 -1 -1 -1 -1 0 1 -1 -1 1 -1 -1 0 1 1 1 1 -1 -1 -1 -1 -1 ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-type-of.exp: -------------------------------------------------------------------------------- 1 | [ "null" "bool" "bool" "int" "int" "float" "string" "string" "set" "set" "list" "lambda" "path" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-lazy-assert.nix: -------------------------------------------------------------------------------- 1 | assert true; 2 | 3 | let 4 | x = assert false; 13; 5 | y = 12; 6 | in 7 | 8 | { inherit x y; }.y 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-siblings.nix: -------------------------------------------------------------------------------- 1 | rec { 2 | outer = 3 | let inner = sibling; 4 | in inner; 5 | 6 | sibling = 42; 7 | } 8 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-mapattrs.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | builtins.mapAttrs (name: value: name + "-" + value) { x = "foo"; y = "bar"; } 4 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-curpos.nix: -------------------------------------------------------------------------------- 1 | # Bla 2 | let 3 | x = __curPos; 4 | y = __curPos; 5 | in [ x.line x.column y.line y.column ] 6 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-fail-eof-in-string.nix: -------------------------------------------------------------------------------- 1 | # https://github.com/NixOS/nix/issues/6562 2 | # Note that this file must not end with a newline. 3 | a 1"$ -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-attrvalues.nix: -------------------------------------------------------------------------------- 1 | [ 2 | (builtins.attrValues { }) 3 | (builtins.attrValues { foo = 1; bar = 2; baz = 3; }) 4 | ] 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-parse-drv-name-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (builtins.parseDrvName (builtins.throw "a"))).success 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-merge-nested-attrs.nix: -------------------------------------------------------------------------------- 1 | { 2 | set = { 3 | a = 1; 4 | }; 5 | 6 | set = { 7 | b = 2; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /docs/mdbook-extra.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | 3 | .hljs-meta.prompt_ { 4 | -webkit-user-select: none; 5 | -moz-user-select: none; 6 | user-select: none; 7 | } 8 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-thunked-if.nix: -------------------------------------------------------------------------------- 1 | let 2 | a = { }; 3 | in 4 | let 5 | c = if builtins.isFunction a then a b else a; 6 | b = { }; 7 | in 8 | c 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-value-pointer-equality.exp: -------------------------------------------------------------------------------- 1 | [ true true true true false false false true true true true true true true true true false false ] 2 | -------------------------------------------------------------------------------- /nix-compat/src/nar/tests/helloworld.nar: -------------------------------------------------------------------------------- 1 | nix-archive-1(typeregularcontents Hello World!) -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-dynamic-attrs.exp: -------------------------------------------------------------------------------- 1 | { binds = true; hasAttrs = true; multiAttrs = true; recBinds = true; selectAttrs = true; selectOrAttrs = true; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-fail-undef-var-2.nix: -------------------------------------------------------------------------------- 1 | let { 2 | 3 | f = {x, y : ["baz" "bar" z "bat"]}: x + y; 4 | 5 | body = f {x = "foo"; y = "bar";}; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-arithmetic-float.nix: -------------------------------------------------------------------------------- 1 | { 2 | add = 12.34 + 25.0; 3 | sub = 20.05 - 5.7; 4 | mul = 28.42 * 3.70; 5 | div = 18.5 / 17.5; 6 | } 7 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-length.nix: -------------------------------------------------------------------------------- 1 | [ 2 | (builtins.length [ ]) 3 | (builtins.length [ 1 ]) 4 | (builtins.length [ "one" "two" "three" ]) 5 | ] 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-contains-nested-non-set.nix: -------------------------------------------------------------------------------- 1 | # ? operator should work even if encountering a non-set value on the 2 | # walk 3 | { a.b = 42; } ? a.b.c 4 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-legacy-let-fix.nix: -------------------------------------------------------------------------------- 1 | let { 2 | a = 21; 3 | b = body.one; 4 | 5 | body = { 6 | one = a * 2; 7 | two = b; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-let-useful-plain-inherit.nix: -------------------------------------------------------------------------------- 1 | with { a = 1; }; 2 | 3 | let 4 | inherit a; 5 | in 6 | 7 | with { a = 2; }; 8 | 9 | a 10 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-or-operator-non-set.nix: -------------------------------------------------------------------------------- 1 | # `or` operator should keep working if it encounters a non-set type. 2 | { a.b = 42; }.a.b.c or "works fine" 3 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-value-display.exp: -------------------------------------------------------------------------------- 1 | [ null true false 42 42 "foo\t\nbar" /home/arthur [ 1 2 3 ] { hello = "world"; } ] 2 | -------------------------------------------------------------------------------- /nix-compat/src/nar/tests/symlink.nar: -------------------------------------------------------------------------------- 1 | nix-archive-1(typesymlinktarget/nix/store/somewhereelse) -------------------------------------------------------------------------------- /nix-compat/src/nix_daemon/framing/mod.rs: -------------------------------------------------------------------------------- 1 | mod framed_read; 2 | pub use framed_read::NixFramedReader; 3 | mod stderr_read; 4 | pub use stderr_read::StderrReadFramedReader; 5 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-dynamic-attrs-bare.exp: -------------------------------------------------------------------------------- 1 | { binds = true; hasAttrs = true; multiAttrs = true; recBinds = true; selectAttrs = true; selectOrAttrs = true; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-tryeval.exp: -------------------------------------------------------------------------------- 1 | { x = { success = true; value = "x"; }; y = { success = false; value = false; }; z = { success = false; value = false; }; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-fix.nix: -------------------------------------------------------------------------------- 1 | let 2 | fix = f: let x = f x; in x; 3 | in 4 | fix (self: { 5 | a = 1; 6 | b = self.a + 20; 7 | c = self.b * 2; 8 | }) 9 | -------------------------------------------------------------------------------- /nix-compat/src/nar/writer/mod.rs: -------------------------------------------------------------------------------- 1 | pub use sync::*; 2 | 3 | pub mod sync; 4 | 5 | #[cfg(test)] 6 | mod test; 7 | 8 | #[cfg(feature = "async")] 9 | pub mod r#async; 10 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-tryeval.nix: -------------------------------------------------------------------------------- 1 | { 2 | x = builtins.tryEval "x"; 3 | y = builtins.tryEval (assert false; "y"); 4 | z = builtins.tryEval (throw "bla"); 5 | } 6 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/imported.nix: -------------------------------------------------------------------------------- 1 | # The function ‘range’ comes from lib.nix and was added to the lexical 2 | # scope by scopedImport. 3 | range 1 5 ++ import ./imported2.nix 4 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-fail-function-formals-typecheck.nix: -------------------------------------------------------------------------------- 1 | # A function with formal set arguments forces its argument set and verifies its type. 2 | ({ ... }@args: 42) [ ] 3 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-cmp-int-false.nix: -------------------------------------------------------------------------------- 1 | { 2 | eq = 69 == 42; 3 | ne = 42 != 42; 4 | lt = 2 < 1; 5 | le = 2 <= 1; 6 | gt = 1 > 2; 7 | ge = 1 >= 2; 8 | } 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-cmp-int-true.nix: -------------------------------------------------------------------------------- 1 | { 2 | eq = 42 == 42; 3 | ne = 69 != 42; 4 | lt = 1 < 2; 5 | le = 2 <= 2; 6 | gt = 2 > 1; 7 | ge = 2 >= 2; 8 | } 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-let.nix: -------------------------------------------------------------------------------- 1 | let 2 | a = 3 | let 4 | b = 1; 5 | c = 2; 6 | in 7 | b + c; 8 | b = 4; 9 | in 10 | a + b 11 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-thunked-functor.nix: -------------------------------------------------------------------------------- 1 | let 2 | __functor = f; 3 | f = self: x: self.out * x; 4 | in 5 | { 6 | inherit __functor; 7 | out = 21; 8 | } 2 9 | -------------------------------------------------------------------------------- /eval/src/tests/mod.rs: -------------------------------------------------------------------------------- 1 | /// Module for one-off tests which do not follow the rest of the 2 | /// test layout. 3 | mod one_offs; 4 | 5 | #[cfg(feature = "nix_tests")] 6 | mod nix_tests; 7 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-filter.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | builtins.filter 4 | (x: x / 2 * 2 == x) 5 | (builtins.concatLists [ (range 0 10) (range 100 110) ]) 6 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-flatten.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | let { 4 | 5 | l = ["1" "2" ["3" ["4"] ["5" "6"]] "7"]; 6 | 7 | body = concat (flatten l); 8 | } 9 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-float.nix: -------------------------------------------------------------------------------- 1 | [ 2 | (1.1 + 2.3) 3 | (builtins.add (0.5 + 0.5) (2.0 + 0.5)) 4 | ((0.5 + 0.5) * (2.0 + 0.5)) 5 | ((1.5 + 1.5) / (0.5 * 4.0)) 6 | ] 7 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-deeply-nested-with.nix: -------------------------------------------------------------------------------- 1 | with { a = 1; b = 1; }; 2 | with { b = 2; c = 2; }; 3 | with { c = 3; d = 3; }; 4 | with { d = 4; }; 5 | 6 | [ a b c d ] 7 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-equality-tolerate-catchable-in-type-field.nix: -------------------------------------------------------------------------------- 1 | (builtins.tryEval (builtins.elem { type = rec { x = throw "fred"; }.x; } [{ type = 3; }])).success 2 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "rust-lang.rust-analyzer" 4 | ], 5 | "unwantedRecommendations": [ 6 | "rust-lang.rust" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-attrs.nix: -------------------------------------------------------------------------------- 1 | let { 2 | as = { x = 123; y = 456; } // { z = 789; } // { z = 987; }; 3 | 4 | body = if as ? a then as.a else assert as ? z; as.z; 5 | } 6 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-elem.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | let xs = range 10 40; in 4 | 5 | [ (builtins.elem 23 xs) (builtins.elem 42 xs) (builtins.elemAt xs 20) ] 6 | 7 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-partition.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | builtins.partition 4 | (x: x / 2 * 2 == x) 5 | (builtins.concatLists [ (range 0 10) (range 100 110) ]) 6 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-fail-scope-5.nix: -------------------------------------------------------------------------------- 1 | let { 2 | 3 | x = "a"; 4 | y = "b"; 5 | 6 | f = {x ? y, y ? x}: x + y; 7 | 8 | body = f {}; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-substring-coerce.nix: -------------------------------------------------------------------------------- 1 | # builtins.substring uses string coercion internally 2 | 3 | builtins.substring 0 2 { 4 | __toString = _: "4200"; 5 | } 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-cmp-num-false.nix: -------------------------------------------------------------------------------- 1 | { 2 | eq = 6.9 == 4; 3 | ne = 4.0 != 4; 4 | lt = 2.5 < 1; 5 | le = 2 <= 1.5; 6 | gt = 1 > 1.1; 7 | ge = 1.5 >= 2; 8 | } 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-elem.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | let xs = range 10 40; in 4 | 5 | [ (builtins.elem 23 xs) (builtins.elem 42 xs) (builtins.elemAt xs 20) ] 6 | 7 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-with-closure.nix: -------------------------------------------------------------------------------- 1 | # Upvalues from `with` require special runtime handling. Do they work? 2 | let 3 | f = with { a = 15; }; n: n * a; 4 | in 5 | f 10 6 | -------------------------------------------------------------------------------- /glue/src/tests/tvix_tests/eval-okay-storePath2.exp: -------------------------------------------------------------------------------- 1 | { plain = "/nix/store/vqsvbisgiqrqa1y0qljigq4ds5h38gym-dummy"; withSubPath = "/nix/store/vqsvbisgiqrqa1y0qljigq4ds5h38gym-dummy/.keep"; } 2 | -------------------------------------------------------------------------------- /nix-compat-derive-tests/tests/ui.rs: -------------------------------------------------------------------------------- 1 | #[cfg(feature = "compile-tests")] 2 | #[test] 3 | fn ui() { 4 | let t = trybuild::TestCases::new(); 5 | t.compile_fail("tests/ui/*.rs"); 6 | } 7 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-groupBy.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | builtins.groupBy (n: 4 | builtins.substring 0 1 (builtins.hashString "sha256" (toString n)) 5 | ) (range 0 31) 6 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-scope-4.nix: -------------------------------------------------------------------------------- 1 | let { 2 | 3 | x = "a"; 4 | y = "b"; 5 | 6 | f = {x ? y, y ? x}: x + y; 7 | 8 | body = f {x = "c";} + f {y = "d";}; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-toxml.exp: -------------------------------------------------------------------------------- 1 | "\n\n \n \n \n \n \n\n" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-closure-self.nix: -------------------------------------------------------------------------------- 1 | let 2 | # self-recursive function should be able to close over itself 3 | f = n: if n <= 0 then "done" else f (n - 1); 4 | in 5 | f 10 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-cmp-num-true.nix: -------------------------------------------------------------------------------- 1 | { 2 | eq = 42.0 == 42; 3 | ne = 6.9 != 4; 4 | lt = 1.5 < 2; 5 | le = 2.0 <= 2.0; 6 | gt = 1.1 > 1; 7 | ge = 2.3 >= 2.3; 8 | } 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-internal-formals.nix: -------------------------------------------------------------------------------- 1 | # Tests formals which have internal default values. 2 | 3 | ({ defaultValue, optional ? defaultValue }: optional) { defaultValue = 42; } 4 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-thunked-with.nix: -------------------------------------------------------------------------------- 1 | # Creates a `with` across multiple thunk boundaries. 2 | 3 | let 4 | set = { 5 | a = with { b = 42; }; b; 6 | }; 7 | in 8 | set.a 9 | -------------------------------------------------------------------------------- /nix-compat-derive-tests/tests/ui/parse_mising_version.stderr: -------------------------------------------------------------------------------- 1 | error: expected `=` 2 | --> tests/ui/parse_mising_version.rs:5:18 3 | | 4 | 5 | #[nix(version)] 5 | | ^ 6 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-overrides.nix: -------------------------------------------------------------------------------- 1 | let 2 | 3 | overrides = { a = 2; }; 4 | 5 | in (rec { 6 | __overrides = overrides; 7 | x = a; 8 | a = 1; 9 | }).x 10 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-tojson-thunks.nix: -------------------------------------------------------------------------------- 1 | let 2 | a = b * 2; 3 | b = 21; 4 | in 5 | builtins.toJSON [ 6 | a 7 | ((n: n * 2) 21) 8 | (builtins.toJSON a) 9 | ] 10 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-cmp-float-false.nix: -------------------------------------------------------------------------------- 1 | { 2 | eq = 6.9 == 4.2; 3 | ne = 4.2 != 4.2; 4 | lt = 2.5 < 1.5; 5 | le = 2.5 <= 1.5; 6 | gt = 1.5 > 2.5; 7 | ge = 1.5 >= 2.5; 8 | } 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-cmp-float-true.nix: -------------------------------------------------------------------------------- 1 | { 2 | eq = 4.2 == 4.2; 3 | ne = 6.9 != 4.2; 4 | lt = 1.5 < 2.5; 5 | le = 2.5 <= 2.5; 6 | gt = 2.3 > 1.2; 7 | ge = 2.3 >= 2.3; 8 | } 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-fib.nix: -------------------------------------------------------------------------------- 1 | let 2 | fib' = i: n: m: 3 | if i == 0 4 | then n 5 | else fib' (i - 1) m (n + m); 6 | 7 | fib = n: fib' n 1 1; 8 | in 9 | fib 10 10 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-foldlStrict-lazy-initial-accumulator.nix: -------------------------------------------------------------------------------- 1 | builtins.foldl' 2 | (_: x: x) 3 | (throw "This is never forced") 4 | [ "but the results of applying op are" 42 ] 5 | -------------------------------------------------------------------------------- /nix-compat/src/wire/ser/display.rs: -------------------------------------------------------------------------------- 1 | use nix_compat_derive::nix_serialize_remote; 2 | 3 | use crate::nixhash; 4 | 5 | nix_serialize_remote!( 6 | #[nix(display)] 7 | nixhash::HashAlgo 8 | ); 9 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-toxml.nix: -------------------------------------------------------------------------------- 1 | # Make sure the expected XML output is produced; in particular, make sure it 2 | # doesn't contain source location information. 3 | builtins.toXML { a = "s"; } 4 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-attrnames.exp: -------------------------------------------------------------------------------- 1 | [ [ ] [ "bar" "baz" "foo" ] [ "Baz" "Foo" "bar" ] [ "Eric Idle" "Graham Chapman" "John Cleese" "Michael Palin" "Terry Gilliam" "Terry Jones" ] ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-genericClosure-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | builtins.tryEval (builtins.genericClosure { operator = (_: [{ key = throw "lol"; }]); startSet = [{ key = "lol"; }]; }) 2 | -------------------------------------------------------------------------------- /nix-compat-derive-tests/tests/ui/deserialize_from_missing.rs: -------------------------------------------------------------------------------- 1 | use nix_compat_derive::NixDeserialize; 2 | 3 | #[derive(NixDeserialize)] 4 | #[nix(from = "u64")] 5 | pub struct Test; 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /nix-compat-derive-tests/tests/ui/deserialize_from_str_missing.rs: -------------------------------------------------------------------------------- 1 | use nix_compat_derive::NixDeserialize; 2 | 3 | #[derive(NixDeserialize)] 4 | #[nix(from_str)] 5 | pub struct Test; 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /nix-compat-derive-tests/tests/ui/parse_bad_nix.stderr: -------------------------------------------------------------------------------- 1 | error: expected attribute arguments in parentheses: #[nix(...)] 2 | --> tests/ui/parse_bad_nix.rs:5:7 3 | | 4 | 5 | #[nix] 5 | | ^^^ 6 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-hashfile.nix: -------------------------------------------------------------------------------- 1 | let 2 | paths = [ ./data ./binary-data ]; 3 | in 4 | builtins.concatLists (map (hash: map (builtins.hashFile hash) paths) ["md5" "sha1" "sha256" "sha512"]) 5 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-fail-regression-20060610.nix: -------------------------------------------------------------------------------- 1 | let { 2 | x = 3 | {gcc}: 4 | { 5 | inherit gcc; 6 | }; 7 | 8 | body = ({ 9 | inherit gcc; 10 | }).gcc; 11 | } 12 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-okay-mixed-nested-attrs-3.nix: -------------------------------------------------------------------------------- 1 | { 2 | services.ssh.enable = true; 3 | services.ssh = { port = 123; }; 4 | services = { 5 | httpd.enable = true; 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-elemat.nix: -------------------------------------------------------------------------------- 1 | [ 2 | (builtins.elemAt [ "foo" "bar" "baz" ] 0) 3 | (builtins.elemAt [ "foo" "bar" "baz" ] 1) 4 | (builtins.elemAt [ "foo" "bar" "baz" ] 2) 5 | ] 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-head-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval e).success) [ 2 | (builtins.head (builtins.throw "a")) 3 | (builtins.head [ (builtins.throw "a") ]) 4 | ] 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-mul.nix: -------------------------------------------------------------------------------- 1 | [ 2 | (builtins.mul 4 9) 3 | (builtins.mul 0 7) 4 | (builtins.mul 7 0) 5 | (builtins.mul 7 2) 6 | (builtins.mul (builtins.mul 4 0.5) 21) 7 | ] 8 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-thunks.nix: -------------------------------------------------------------------------------- 1 | # If a thunk yields another thunk, OpForce should keep forcing until 2 | # there is a value. 3 | let 4 | a = b; 5 | b = c; 6 | c = 42; 7 | in 8 | a 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-regex-match.exp: -------------------------------------------------------------------------------- 1 | [ true true false true true true true false false true false [ "foobar" ] [ "FOO" ] [ "/path/to/" "/path/to" "foobar" "nix" ] [ null null "foobar" "cc" ] ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-value-pointer-compare.nix: -------------------------------------------------------------------------------- 1 | # For an explanation of this behavior see //tvix/docs/value-pointer-equality.md 2 | let 3 | f = owo: "thia"; 4 | in 5 | 6 | [ f 42 ] > [ f 21 ] 7 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-fail-dup-attrs-2.nix: -------------------------------------------------------------------------------- 1 | let { 2 | 3 | as = { 4 | x = 123; 5 | y = 456; 6 | }; 7 | 8 | bs = { 9 | x = 789; 10 | inherit (as) x; 11 | }; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-fail-builtins-tojson-tostring-notcallable.nix: -------------------------------------------------------------------------------- 1 | # attribute sets with a non-callable `__toString` can not be 2 | # serialised to JSON. 3 | builtins.toJSON { 4 | __toString = 42; 5 | } 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-genList-function-strictness.nix: -------------------------------------------------------------------------------- 1 | let 2 | self = 3 | let 4 | l = builtins.genList (builtins.head self) 3; 5 | in 6 | [ (x: x) ] ++ l; 7 | in 8 | self 9 | -------------------------------------------------------------------------------- /nix-compat-derive-tests/tests/ui/deserialize_try_from_missing.rs: -------------------------------------------------------------------------------- 1 | use nix_compat_derive::NixDeserialize; 2 | 3 | #[derive(NixDeserialize)] 4 | #[nix(try_from = "u64")] 5 | pub struct Test; 6 | 7 | fn main() {} 8 | -------------------------------------------------------------------------------- /nix-compat-derive-tests/tests/ui/parse_bad_default_path.stderr: -------------------------------------------------------------------------------- 1 | error: expected identifier 2 | --> tests/ui/parse_bad_default_path.rs:5:21 3 | | 4 | 5 | #[nix(default = "12")] 5 | | ^^^^ 6 | -------------------------------------------------------------------------------- /nix-compat/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | // Pick up new test case files 3 | // https://github.com/la10736/rstest/issues/256 4 | println!("cargo:rerun-if-changed=src/derivation/tests/derivation_tests") 5 | } 6 | -------------------------------------------------------------------------------- /eval/clippy.toml: -------------------------------------------------------------------------------- 1 | # See https://nnethercote.github.io/perf-book/hashing.html. Use FxHashMap and 2 | # FxHashSet, not HashMap and HashSet 3 | disallowed-types = ["std::collections::HashMap", "std::collections::HashSet"] 4 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-concatmap.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | [ (builtins.concatMap (x: if x / 2 * 2 == x then [] else [ x ]) (range 0 10)) 4 | (builtins.concatMap (x: [x] ++ ["z"]) ["a" "b"]) 5 | ] 6 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-hashstring.nix: -------------------------------------------------------------------------------- 1 | let 2 | strings = [ "" "text 1" "text 2" ]; 3 | in 4 | builtins.concatLists (map (hash: map (builtins.hashString hash) strings) ["md5" "sha1" "sha256" "sha512"]) 5 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-fail-dup-attrs-3.nix: -------------------------------------------------------------------------------- 1 | let { 2 | 3 | as = { 4 | x = 123; 5 | y = 456; 6 | }; 7 | 8 | bs = rec { 9 | x = 789; 10 | inherit (as) x; 11 | }; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-catattrs-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval e).success) [ (builtins.catAttrs "a" (builtins.throw "b")) (builtins.catAttrs (builtins.throw "a") { a = 1; }) ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-type-predicates.exp: -------------------------------------------------------------------------------- 1 | [ true true false true true false true true false true true false true true false true true false true true false true true false true true true false ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-inherit-string-ident.nix: -------------------------------------------------------------------------------- 1 | # identifiers in inherits can be string-like expressions 2 | 3 | let 4 | set = { 5 | inherit ({ value = 42; }) "value"; 6 | }; 7 | in 8 | set.value 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-lazy-with.nix: -------------------------------------------------------------------------------- 1 | # The 'namespace' of a with should only be evaluated if an identifier 2 | # from it is actually accessed. 3 | 4 | with (abort "should not be evaluated"); 5 | 6 | 42 7 | -------------------------------------------------------------------------------- /nix-compat-derive-tests/tests/ui/parse_bad_nix.rs: -------------------------------------------------------------------------------- 1 | use nix_compat_derive::NixDeserialize; 2 | 3 | #[derive(NixDeserialize)] 4 | pub struct Test { 5 | #[nix] 6 | version: u8, 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-tojson.exp: -------------------------------------------------------------------------------- 1 | "{\"a\":123,\"b\":-456,\"c\":\"foo\",\"d\":\"foo\\n\\\"bar\\\"\",\"e\":true,\"f\":false,\"g\":[1,2,3],\"h\":[\"a\",[\"b\",{\"foo\\nbar\":{}}]],\"i\":3,\"j\":1.44,\"k\":\"foo\"}" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos.nix: -------------------------------------------------------------------------------- 1 | let 2 | as = { 3 | foo = "bar"; 4 | }; 5 | pos = builtins.unsafeGetAttrPos "foo" as; 6 | in { inherit (pos) column line; file = baseNameOf pos.file; } 7 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-fail-foldlStrict-strict-op-application.nix: -------------------------------------------------------------------------------- 1 | builtins.foldl' 2 | (_: f: f null) 3 | (throw "This doesn't explode") 4 | [ (_: throw "Not the final value, but is still forced!") (_: 23) ] 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-mapAttrs-function-strictness.nix: -------------------------------------------------------------------------------- 1 | let 2 | self = 3 | let 4 | s = builtins.mapAttrs self.f { a = 1; b = 2; }; 5 | in 6 | { f = _: x: x; } // s; 7 | in 8 | self 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-contains-non-set.nix: -------------------------------------------------------------------------------- 1 | # Nix allows using the ? operator on non-set types, in which case it 2 | # should always return false. 3 | [ (123 ? key) ("foo" ? key) (null ? key) ([ "key" ] ? key) ] 4 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-tryeval.exp: -------------------------------------------------------------------------------- 1 | { v = false; w = { success = false; value = false; }; x = { success = true; value = "x"; }; y = { success = false; value = false; }; z = { success = false; value = false; }; } 2 | -------------------------------------------------------------------------------- /nix-compat-derive-tests/tests/ui/parse_bad_default.stderr: -------------------------------------------------------------------------------- 1 | error: expected nix attribute default to be string 2 | --> tests/ui/parse_bad_default.rs:5:21 3 | | 4 | 5 | #[nix(default = 12)] 5 | | ^^ 6 | -------------------------------------------------------------------------------- /nix-compat-derive-tests/tests/ui/parse_bad_version.stderr: -------------------------------------------------------------------------------- 1 | error: expected nix attribute version to be string 2 | --> tests/ui/parse_bad_version.rs:5:21 3 | | 4 | 5 | #[nix(version = 12)] 5 | | ^^ 6 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-attrs4.nix: -------------------------------------------------------------------------------- 1 | let 2 | 3 | as = { x.y.z = 123; a.b.c = 456; }; 4 | 5 | bs = null; 6 | 7 | in [ (as ? x) (as ? y) (as ? x.y.z) (as ? x.y.z.a) (as ? x.y.a) (as ? a.b.c) (bs ? x) (bs ? x.y.z) ] 8 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-string-length-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval e).success) [ 2 | (builtins.stringLength (builtins.throw "a")) 3 | # FIXME(raitobezarius): test coercions too. 4 | ] 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-cmp-str-false.nix: -------------------------------------------------------------------------------- 1 | { 2 | eq = "test" == "not test"; 3 | ne = "test" != "test"; 4 | lt = "bcd" < "abc"; 5 | le = "bcd" <= "abc"; 6 | gt = "abc" > "bcd"; 7 | ge = "abc" >= "bcd"; 8 | } 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-cmp-str-true.nix: -------------------------------------------------------------------------------- 1 | { 2 | eq = "test" == "test"; 3 | ne = "test" != "not test"; 4 | lt = "abc" < "bcd"; 5 | le = "bcd" <= "bcd"; 6 | gt = "bcd" > "abc"; 7 | ge = "bcd" >= "bcd"; 8 | } 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-foldlStrict-lazy-elements.nix: -------------------------------------------------------------------------------- 1 | let 2 | lst = builtins.foldl' 3 | (acc: x: acc ++ [ x ]) 4 | [ ] 5 | [ 42 (throw "this shouldn't be evaluated") ]; 6 | in 7 | 8 | builtins.head lst 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-internal-formals-deferred.nix: -------------------------------------------------------------------------------- 1 | # Tests formals which have internal default values that must be deferred. 2 | 3 | ({ optional ? defaultValue, defaultValue }: optional) { defaultValue = 42; } 4 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-let-inherit.nix: -------------------------------------------------------------------------------- 1 | let 2 | set = { 3 | a = 1; 4 | }; 5 | in 6 | let 7 | set2 = { 8 | b = 1; 9 | }; 10 | inherit (set) a; 11 | inherit (set2) b; 12 | in 13 | a + b 14 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nested-deferred-upvalue.nix: -------------------------------------------------------------------------------- 1 | let 2 | doubler = n: outer n; 3 | outer = 4 | let 5 | inner = n: a * n; 6 | a = 2; 7 | in 8 | inner; 9 | in 10 | doubler 10 11 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-builtins-add.nix: -------------------------------------------------------------------------------- 1 | [ 2 | (builtins.add 2 3) 3 | (builtins.add 2 2) 4 | (builtins.typeOf (builtins.add 2 2)) 5 | ("t" + "t") 6 | (builtins.typeOf (builtins.add 2.0 2)) 7 | (builtins.add 2.0 2) 8 | ] 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-function-args-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval e).success) [ 2 | (builtins.functionArgs (_: builtins.throw "a")) 3 | (builtins.functionArgs (builtins.throw "b")) 4 | ] 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-split-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval e).success) [ 2 | (builtins.split (builtins.throw "regex") "abc") 3 | (builtins.split "[^/]" (builtins.throw "string")) 4 | ] 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-recursive-attrs-all-features.nix: -------------------------------------------------------------------------------- 1 | let a = 1; 2 | in 3 | (rec { 4 | inherit a; 5 | 6 | b = { 7 | c = a + 20; 8 | }; 9 | 10 | inherit (b) c; 11 | 12 | d = c * 2; 13 | }).d 14 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-thunked-string-interpolation.nix: -------------------------------------------------------------------------------- 1 | let 2 | final = { text = "strict literal"; inherit x y; }; 3 | x = "lazy ${throw "interpolation"}"; 4 | y = "${throw "also lazy!"}"; 5 | in 6 | 7 | final.text 8 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-xml.nix: -------------------------------------------------------------------------------- 1 | { 2 | attrspat = args@{ x, y, z }: x; 3 | attrspat-ellipsis = args@{ x, y, z, ... }: x; 4 | 5 | noattrspat = { x, y, z }: x; 6 | noattrspat-ellipsis = { x, y, z, ... }: x; 7 | } 8 | -------------------------------------------------------------------------------- /glue/src/tests/tvix_tests/eval-okay-context-propagation.exp: -------------------------------------------------------------------------------- 1 | [ true true true true true true true true true true true true true true true true true true true true true true true true true true true true true true true true true true ] 2 | -------------------------------------------------------------------------------- /nix-compat/src/derivation/tests/derivation_tests/ok/m1vfixn8iprlf0v9abmlrz7mjw1xj8kp-cp1252.drv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvlfyi/tvix/HEAD/nix-compat/src/derivation/tests/derivation_tests/ok/m1vfixn8iprlf0v9abmlrz7mjw1xj8kp-cp1252.drv -------------------------------------------------------------------------------- /nix-compat/src/derivation/tests/derivation_tests/ok/x6p0hg79i3wg0kkv7699935f7rrj9jf3-latin1.drv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvlfyi/tvix/HEAD/nix-compat/src/derivation/tests/derivation_tests/ok/x6p0hg79i3wg0kkv7699935f7rrj9jf3-latin1.drv -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-fail-builtins-substring-negative-start.nix: -------------------------------------------------------------------------------- 1 | # Negative start is illegal, but negative length works, see 2 | # eval-okay-builtins-substring-negative-length.nix 3 | builtins.substring (-1) 1 "Wiggly Donkers" 4 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-hashString.nix: -------------------------------------------------------------------------------- 1 | [ 2 | (builtins.hashString "md5" "tvix") 3 | (builtins.hashString "sha1" "tvix") 4 | (builtins.hashString "sha256" "tvix") 5 | (builtins.hashString "sha512" "tvix") 6 | ] 7 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-deferred-with.nix: -------------------------------------------------------------------------------- 1 | # Tests using `with` on a set that does not yet exist on the stack. 2 | 3 | let 4 | result = with set; value; 5 | set = { 6 | value = 42; 7 | }; 8 | in 9 | result 10 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-lazy-with-nested.nix: -------------------------------------------------------------------------------- 1 | # The 'namespace' of a with should only be evaluated if an identifier 2 | # from it is actually accessed. 3 | 4 | with (abort "should not be evaluated"); 5 | let a = dynamic; in 42 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-let-inherit-from-later-bound.nix: -------------------------------------------------------------------------------- 1 | let 2 | inherit (c) d; 3 | inherit (a) b c; 4 | 5 | a = { 6 | b = 20; 7 | c = { 8 | d = 3; 9 | }; 10 | }; 11 | in 12 | 13 | b + d 14 | -------------------------------------------------------------------------------- /glue/src/tests/tvix_tests/eval-fail-fetchurl-invalid-attrs.nix: -------------------------------------------------------------------------------- 1 | (builtins.fetchurl { 2 | url = "https://test.example/owo"; 3 | # Only "sha256" is accepted here. 4 | hash = "sha256-Xa1Jbl2Eq5+L0ww+Ph1osA3Z/Dxe/RkN1/dITQCdXFk="; 5 | }) 6 | -------------------------------------------------------------------------------- /nix-compat-derive-tests/tests/ui/parse_bad_default.rs: -------------------------------------------------------------------------------- 1 | use nix_compat_derive::NixDeserialize; 2 | 3 | #[derive(NixDeserialize)] 4 | pub struct Test { 5 | #[nix(default = 12)] 6 | version: u8, 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /nix-compat-derive-tests/tests/ui/parse_bad_version.rs: -------------------------------------------------------------------------------- 1 | use nix_compat_derive::NixDeserialize; 2 | 3 | #[derive(NixDeserialize)] 4 | pub struct Test { 5 | #[nix(version = 12)] 6 | version: u8, 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /nix-compat-derive-tests/tests/ui/parse_mising_version.rs: -------------------------------------------------------------------------------- 1 | use nix_compat_derive::NixDeserialize; 2 | 3 | #[derive(NixDeserialize)] 4 | pub struct Test { 5 | #[nix(version)] 6 | version: u8, 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-functionargs.exp: -------------------------------------------------------------------------------- 1 | [ "stdenv" "fetchurl" "aterm-stdenv" "aterm-stdenv2" "libX11" "libXv" "mplayer-stdenv2.libXv-libX11" "mplayer-stdenv2.libXv-libX11_2" "nix-stdenv-aterm-stdenv" "nix-stdenv2-aterm2-stdenv2" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-getattrpos-functionargs.nix: -------------------------------------------------------------------------------- 1 | let 2 | fun = { foo }: {}; 3 | pos = builtins.unsafeGetAttrPos "foo" (builtins.functionArgs fun); 4 | in { inherit (pos) column line; file = baseNameOf pos.file; } 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-substring-negative-length.nix: -------------------------------------------------------------------------------- 1 | [ 2 | (builtins.substring 0 (-1) "SIP dial") 3 | (builtins.substring 13 (-1) "Nichtraucher Lounge") 4 | (builtins.substring 12 (-2) "Nichtraucher Lounge") 5 | ] 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-functionargs.exp: -------------------------------------------------------------------------------- 1 | [ "stdenv" "fetchurl" "aterm-stdenv" "aterm-stdenv2" "libX11" "libXv" "mplayer-stdenv2.libXv-libX11" "mplayer-stdenv2.libXv-libX11_2" "nix-stdenv-aterm-stdenv" "nix-stdenv2-aterm2-stdenv2" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-unpoison-scope.nix: -------------------------------------------------------------------------------- 1 | let 2 | poisoned = 3 | let 4 | true = 1; 5 | false = 2; 6 | null = 3; 7 | in 8 | [ true false null ]; 9 | in 10 | [ true false null ] ++ poisoned 11 | -------------------------------------------------------------------------------- /glue/src/tests/tvix_tests/eval-fail-tofile-wrongctxtype.nix: -------------------------------------------------------------------------------- 1 | # in 'toFile': the file 'foo' cannot refer to derivation outputs, at (string):1:1 2 | builtins.toFile "foo" "${(builtins.derivation {name = "foo"; builder = ":"; system = ":";})}" 3 | 4 | -------------------------------------------------------------------------------- /nix-compat-derive-tests/tests/ui/parse_bad_default_path.rs: -------------------------------------------------------------------------------- 1 | use nix_compat_derive::NixDeserialize; 2 | 3 | #[derive(NixDeserialize)] 4 | pub struct Test { 5 | #[nix(default = "12")] 6 | version: u8, 7 | } 8 | 9 | fn main() {} 10 | -------------------------------------------------------------------------------- /nix-compat/src/aterm/mod.rs: -------------------------------------------------------------------------------- 1 | mod escape; 2 | mod parser; 3 | 4 | pub(crate) use escape::escape_bytes; 5 | pub(crate) use parser::parse_bytes_field; 6 | pub(crate) use parser::parse_string_field; 7 | pub(crate) use parser::parse_string_list; 8 | -------------------------------------------------------------------------------- /nix-compat/src/derivation/tests/derivation_tests/ok/m1vfixn8iprlf0v9abmlrz7mjw1xj8kp-cp1252.drv.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvlfyi/tvix/HEAD/nix-compat/src/derivation/tests/derivation_tests/ok/m1vfixn8iprlf0v9abmlrz7mjw1xj8kp-cp1252.drv.json -------------------------------------------------------------------------------- /nix-compat/src/derivation/tests/derivation_tests/ok/x6p0hg79i3wg0kkv7699935f7rrj9jf3-latin1.drv.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvlfyi/tvix/HEAD/nix-compat/src/derivation/tests/derivation_tests/ok/x6p0hg79i3wg0kkv7699935f7rrj9jf3-latin1.drv.json -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-path-antiquotation.exp: -------------------------------------------------------------------------------- 1 | { absolute = /foo; expr = /pwd/lang/foo/bar; home = /fake-home/foo; notfirst = /pwd/lang/bar/foo; simple = /pwd/lang/foo; slashes = /foo/bar; surrounded = /pwd/lang/a-foo-b; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-add.nix: -------------------------------------------------------------------------------- 1 | [ 2 | (builtins.add 7 11) 3 | (builtins.add 7.9 11) 4 | (builtins.add 7 11.9) 5 | (builtins.add 7.2 11.9) 6 | (builtins.add 7.1 11.9) 7 | (builtins.add (builtins.add 21 10) 11) 8 | ] 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-all-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval e).success) [ (builtins.all (builtins.throw "a") [ "" ]) (builtins.all (x: true) (builtins.throw "b")) (builtins.all (_: builtins.throw "x") [ "" ]) ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-any-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval e).success) [ (builtins.any (builtins.throw "a") [ "" ]) (builtins.any (x: true) (builtins.throw "b")) (builtins.any (_: builtins.throw "a") [ "" ]) ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-partition.exp: -------------------------------------------------------------------------------- 1 | [ { right = [ 1 2 3 4 5 ]; wrong = [ ]; } { right = [ ]; wrong = [ 1 2 3 4 5 ]; } { right = [ 2 ]; wrong = [ 1 3 4 5 ]; } { right = [ [ 1 2 ] [ 3 4 ] ]; wrong = [ [ 1 ] [ 2 ] [ 3 ] ]; } ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-sub.nix: -------------------------------------------------------------------------------- 1 | [ 2 | (builtins.sub 7 11) 3 | (builtins.sub 7.9 11) 4 | (builtins.sub 7 11.9) 5 | (builtins.sub 7.2 11.9) 6 | (builtins.sub 7.9 11.9) 7 | (builtins.sub (builtins.sub 123 23) 58) 8 | ] 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-to-path-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval (builtins.toPath e)).success) [ 2 | (builtins.throw "a") 3 | (./xyz + (builtins.throw "p")) 4 | # FIXME: test derivations and files. 5 | ] 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-tojson-outpath-nested.nix: -------------------------------------------------------------------------------- 1 | # Attribute sets with an `outPath` can contain _any_ serialisable 2 | # value in that field. 3 | builtins.toJSON { 4 | outPath = { 5 | a = 40; 6 | b = 2; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-foldlStrict.nix: -------------------------------------------------------------------------------- 1 | [ 2 | (builtins.foldl' builtins.add 0 [ 1 2 3 ]) 3 | (builtins.foldl' (l1: l2: l1 ++ l2) [ 0 ] [ [ 1 ] [ 2 3 ] ]) 4 | (builtins.foldl' (x: y: if x == 0 then y else x * y) 0 [ 1 2 ]) 5 | ] 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-mutually-recursive-let-binding.nix: -------------------------------------------------------------------------------- 1 | let 2 | a = { 3 | a = 3; 4 | b = b.b; 5 | }; 6 | 7 | b = { 8 | a = a.a - 2; 9 | b = 2; 10 | c = a.c or 3; 11 | }; 12 | in 13 | 14 | a // b 15 | -------------------------------------------------------------------------------- /glue/src/tests/tvix_tests/eval-fail-fetchtarball-invalid-attrs.nix: -------------------------------------------------------------------------------- 1 | (builtins.fetchTarball { 2 | url = "https://test.example/owo"; 3 | # Only "sha256" is accepted here. 4 | hash = "sha256-Xa1Jbl2Eq5+L0ww+Ph1osA3Z/Dxe/RkN1/dITQCdXFk="; 5 | }) 6 | -------------------------------------------------------------------------------- /nix-compat-derive-tests/tests/ui/deserialize_bad_type.rs: -------------------------------------------------------------------------------- 1 | use nix_compat_derive::NixDeserialize; 2 | 3 | pub struct BadType; 4 | 5 | #[derive(NixDeserialize)] 6 | pub struct Test { 7 | version: BadType, 8 | } 9 | 10 | fn main() {} 11 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-new-let.nix: -------------------------------------------------------------------------------- 1 | let 2 | 3 | f = z: 4 | 5 | let 6 | x = "foo"; 7 | y = "bar"; 8 | body = 1; # compat test 9 | in 10 | z + x + y; 11 | 12 | arg = "xyzzy"; 13 | 14 | in f arg 15 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-types.exp: -------------------------------------------------------------------------------- 1 | [ true false true false true false true false true true true true true true true true true true true false true true true false "int" "bool" "string" "null" "set" "list" "lambda" "lambda" "lambda" "lambda" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-tojson-outpath.nix: -------------------------------------------------------------------------------- 1 | # Attribute sets with an `outPath` have that outPath itself serialised 2 | # to string. 3 | builtins.toJSON { 4 | outPath = "/nix/store/jzka5ndnygkkfjfvpqwjipqp75lhz138-emacs-28.2"; 5 | } 6 | -------------------------------------------------------------------------------- /glue/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | // Pick up new test case files 3 | // https://github.com/la10736/rstest/issues/256 4 | println!("cargo:rerun-if-changed=src/tests/nix_tests"); 5 | println!("cargo:rerun-if-changed=src/tests/tvix_tests") 6 | } 7 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-fail-nonexist-path.nix: -------------------------------------------------------------------------------- 1 | # This must fail to evaluate, since ./fnord doesn't exist. If it did 2 | # exist, it would produce "/nix/store/-fnord/xyzzy" (with an 3 | # appropriate context). 4 | "${./fnord}/xyzzy" 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-unsafe-discard-string-context-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval (builtins.unsafeDiscardStringContext e)).success) [ 2 | (builtins.throw "a") 3 | # FIXME: test derivations with throwables. 4 | ] 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-coerce-opadd.nix: -------------------------------------------------------------------------------- 1 | [ 2 | ({ __toString = _: "lord"; } + "nikon") 3 | ("zero" + { __toString = _: "cool"; }) 4 | (/tmp/31337 + "h4x0r") 5 | ("foo" + { outPath = "blah"; }) 6 | ({ outPath = "blah"; } + "foo") 7 | ] 8 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-deferred-unary-formals.nix: -------------------------------------------------------------------------------- 1 | # Application of unary operators on deferred formals arguments (via 2 | # defaulting), see also b/255. 3 | [ 4 | (({ b ? !a, a }: b) { a = true; }) 5 | (({ b ? -a, a }: b) { a = 2; }) 6 | ] 7 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-manual-rec.nix: -------------------------------------------------------------------------------- 1 | # Manual desugaring of something similar to `rec`, to test lower level 2 | # recursion primitives. 3 | 4 | let 5 | set = with set; { 6 | a = 21; 7 | b = a * 2; 8 | }; 9 | in 10 | set.b 11 | -------------------------------------------------------------------------------- /nix-compat-derive-tests/tests/ui/deserialize_remote_missing_attr.stderr: -------------------------------------------------------------------------------- 1 | error: Missing from_str, from or try_from attribute 2 | --> tests/ui/deserialize_remote_missing_attr.rs:11:5 3 | | 4 | 11 | / #[nix()] 5 | 12 | | Value 6 | | |_________^ 7 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-fail-builtins-tojson-tostring-strong.nix: -------------------------------------------------------------------------------- 1 | # String coercions when using builtins.toJSON on an attribute set with 2 | # a `__toString` attribute should be weak. 3 | builtins.toJSON { 4 | __toString = self: self.x; 5 | x = 42; 6 | } 7 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-filter-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval e).success) [ (builtins.filter (builtins.throw "a") [ "" ]) (builtins.filter (x: true) (builtins.throw "b")) (builtins.filter (_: builtins.throw "x") [ "" ]) ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-map-function-strictness.nix: -------------------------------------------------------------------------------- 1 | let 2 | self = 3 | let 4 | l = builtins.map (builtins.head self) [ 2 "." 18 https://github.com/NixOS/nix/issues/9779 "-.-" ]; 5 | in 6 | [ (x: x) ] ++ l; 7 | in 8 | self 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-toString.exp: -------------------------------------------------------------------------------- 1 | [ "" " " " /deep/thought" " 2 3" " flat" "1" "4.200000" "" "" "1" "foo" "/etc" "Hello World" "Hello World" "1" "out" "2" " /deep/thought 2 3 flat 1 4.200000 1 foo /etc Hello World Hello World 1 out 2" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-tojson-literals.nix: -------------------------------------------------------------------------------- 1 | # tests serialisation of literal data 2 | builtins.toJSON [ 3 | 42 4 | "hello" 5 | 13.37 6 | [ ] 7 | [ 1 2 3 ] 8 | { } 9 | { name = "foo"; value = 42; } 10 | { foo = 42; } 11 | ] 12 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-observe-infinite-attrs.nix: -------------------------------------------------------------------------------- 1 | # The below attribute set is infinitely large, but we should be able 2 | # to observe it as long as we don't access its entire value. 3 | 4 | let as = { x = 123; y = as; }; in builtins.attrNames as.y.y 5 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-toplevel-finaliser.nix: -------------------------------------------------------------------------------- 1 | # A simple expression with upvalue resolution beyond the target stack 2 | # index of the root expression. 3 | 4 | let 5 | a = 1; 6 | b = 2; 7 | c = 3; 8 | in 9 | { 10 | inherit a b c; 11 | } 12 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-tryeval.nix: -------------------------------------------------------------------------------- 1 | { 2 | v = (builtins.tryEval (toString )).value; 3 | w = builtins.tryEval ; 4 | x = builtins.tryEval "x"; 5 | y = builtins.tryEval (assert false; "y"); 6 | z = builtins.tryEval (throw "bla"); 7 | } 8 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-readFileType.nix: -------------------------------------------------------------------------------- 1 | { 2 | bar = builtins.readFileType ./readDir/bar; 3 | foo = builtins.readFileType ./readDir/foo; 4 | linked = builtins.readFileType ./readDir/linked; 5 | ldir = builtins.readFileType ./readDir/ldir; 6 | } 7 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-assert-thunk-condition.nix: -------------------------------------------------------------------------------- 1 | let 2 | condition = x: y: x < y; 3 | in 4 | 5 | # The function application here will become a thunk which verifies that 6 | # assert forces the condition expression correctly. 7 | assert condition 21 42; 21 8 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-concat-map-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval e).success) [ (builtins.concatMap (builtins.throw "a") [ "" ]) (builtins.concatMap (_: builtins.throw "x") [ "" ]) (builtins.concatMap (_: [ ]) (builtins.throw "a")) ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-map-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval e).success) [ 2 | (builtins.map (builtins.throw "a") [ "" ]) 3 | (builtins.map (x: true) (builtins.throw "b")) 4 | (builtins.map (_: builtins.throw "x") [ "" ]) 5 | ] 6 | -------------------------------------------------------------------------------- /glue/src/tests/tvix_tests/eval-okay-tofile.exp: -------------------------------------------------------------------------------- 1 | [ "/nix/store/vxjiwkjkn7x4079qvh1jkl5pn05j2aw0-foo" "/nix/store/i7liwr52956m86kxp7dgbcwsk56r27v6-foo" "/nix/store/yw8k7ixk1zvb113p4y0bl3ahjxd5h9sr-foo" { "/nix/store/yw8k7ixk1zvb113p4y0bl3ahjxd5h9sr-foo" = { path = true; }; } ] 2 | -------------------------------------------------------------------------------- /serde/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tvix-serde" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | tvix-eval = { path = "../eval" } 8 | serde = { workspace = true, features = ["derive"] } 9 | bstr = { workspace = true, features = ["serde"] } 10 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-fail-foldlStrict-strict-op-application.nix: -------------------------------------------------------------------------------- 1 | # Tests that the result of applying op is forced even if the value is never used 2 | builtins.foldl' 3 | (_: f: f null) 4 | null 5 | [ (_: throw "Not the final value, but is still forced!") (_: 23) ] 6 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-path.nix: -------------------------------------------------------------------------------- 1 | builtins.path 2 | { path = ./.; 3 | filter = path: _: baseNameOf path == "data"; 4 | recursive = true; 5 | sha256 = "1yhm3gwvg5a41yylymgblsclk95fs6jy72w0wv925mmidlhcq4sw"; 6 | name = "output"; 7 | } 8 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-fail-outer-value-never-pointer-equal.nix: -------------------------------------------------------------------------------- 1 | # For an explanation of this behavior see //tvix/docs/value-pointer-equality.md 2 | let 3 | x = { foo = throw "foo"; }; 4 | in 5 | 6 | # while `builtins.seq x null` would succeed, this fails! 7 | x == x 8 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-concat-lists-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval e).success) [ (builtins.concatLists (builtins.throw "a")) (builtins.concatLists [ [ ] (builtins.throw "a") ]) (builtins.concatLists [ [ ] [ ] [ builtins.throw "a" ] ]) ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-gen-list-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval e).success) [ 2 | (builtins.genList (builtins.throw "a") 10) 3 | (builtins.genList (i: "") (builtins.throw "b")) 4 | (builtins.genList (i: builtins.throw "x") 5) 5 | ] 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-stable-sort.nix: -------------------------------------------------------------------------------- 1 | let 2 | keys = [ 1 2 3 2 2 2 5 0 5 5 4 3 2 1 2 3 22 ]; 3 | in 4 | 5 | builtins.sort 6 | (a: b: a.key < b.key) 7 | (builtins.genList (index: { inherit index; key = builtins.elemAt keys index; }) (builtins.length keys)) 8 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-toxml.exp: -------------------------------------------------------------------------------- 1 | "\n\n \n \n \n \n \n \n \n \n\n" 2 | -------------------------------------------------------------------------------- /glue/src/tests/nix_tests/eval-okay-context.nix: -------------------------------------------------------------------------------- 1 | let s = "foo ${builtins.substring 33 100 (baseNameOf "${./eval-okay-context.nix}")} bar"; 2 | in 3 | if s != "foo eval-okay-context.nix bar" 4 | then abort "context not discarded" 5 | else builtins.unsafeDiscardStringContext s 6 | 7 | -------------------------------------------------------------------------------- /glue/src/tests/tvix_tests/eval-okay-storePath2.nix: -------------------------------------------------------------------------------- 1 | let 2 | path = builtins.unsafeDiscardStringContext "${../dummy}"; 3 | storePath = builtins.storePath path; 4 | in 5 | { 6 | plain = builtins.storePath path; 7 | withSubPath = builtins.storePath (path + "/.keep"); 8 | } 9 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-groupBy.exp: -------------------------------------------------------------------------------- 1 | { "1" = [ 9 ]; "2" = [ 8 ]; "3" = [ 13 29 ]; "4" = [ 3 4 10 11 17 18 ]; "5" = [ 0 23 26 28 ]; "6" = [ 1 12 21 27 30 ]; "7" = [ 7 22 ]; "8" = [ 14 ]; "9" = [ 19 ]; b = [ 16 25 ]; c = [ 24 ]; d = [ 2 ]; e = [ 5 6 15 31 ]; f = [ 20 ]; } 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-access-strange-identifier.nix: -------------------------------------------------------------------------------- 1 | let 2 | # There is no syntax for accessing this identifier in an ordinary 3 | # way. 4 | "foo bar" = 42; 5 | in 6 | ({ 7 | # but we *can* inherit it back out 8 | inherit "foo bar"; 9 | })."foo bar" 10 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-fail-hashfile-missing.nix: -------------------------------------------------------------------------------- 1 | let 2 | paths = [ ./this-file-is-definitely-not-there-7392097 "/and/neither/is/this/37293620" ]; 3 | in 4 | toString (builtins.concatLists (map (hash: map (builtins.hashFile hash) paths) ["md5" "sha1" "sha256" "sha512"])) 5 | 6 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-concatstringssep.nix: -------------------------------------------------------------------------------- 1 | with builtins; 2 | 3 | [ (concatStringsSep "" []) 4 | (concatStringsSep "" ["foo" "bar" "xyzzy"]) 5 | (concatStringsSep ", " ["foo" "bar" "xyzzy"]) 6 | (concatStringsSep ", " ["foo"]) 7 | (concatStringsSep ", " []) 8 | ] 9 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-sort.exp: -------------------------------------------------------------------------------- 1 | [ [ 42 77 147 249 483 526 ] [ 526 483 249 147 77 42 ] [ "bar" "fnord" "foo" "xyzzy" ] [ { key = 1; value = "foo"; } { key = 1; value = "fnord"; } { key = 2; value = "bar"; } ] [ [ ] [ ] [ 1 ] [ 1 4 ] [ 1 5 ] [ 1 6 ] [ 2 ] [ 2 3 ] [ 3 ] [ 3 ] ] ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-concat-lists.nix: -------------------------------------------------------------------------------- 1 | [ 2 | (builtins.concatLists [ ]) 3 | (builtins.concatLists [ [ 1 2 ] [ 3 4 ] [ 5 6 ] ]) 4 | (builtins.concatLists [ [ [ 1 ] [ 2 ] ] [ [ 3 ] ] [ ] ]) 5 | (builtins.concatLists [ [ 1 2 ] [ ] [ 3 4 ] [ ] [ 5 6 ] ]) 6 | ] 7 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-group-by-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval e).success) [ 2 | (builtins.groupBy (builtins.throw "a") [ "" ]) 3 | (builtins.groupBy (x: true) (builtins.throw "b")) 4 | (builtins.groupBy (_: builtins.throw "x") [ "" ]) 5 | ] 6 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-context.nix: -------------------------------------------------------------------------------- 1 | let s = "foo ${builtins.substring 33 100 (baseNameOf "${./eval-okay-context.nix}")} bar"; 2 | in 3 | if s != "foo eval-okay-context.nix bar" 4 | then abort "context not discarded" 5 | else builtins.unsafeDiscardStringContext s 6 | 7 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-catAttrs.nix: -------------------------------------------------------------------------------- 1 | builtins.catAttrs "foo" [ 2 | { foo = 21; } 3 | { bar = 23; foo = "+"; } 4 | { } 5 | { bar = 12; } 6 | { foo = 21 + 0; } 7 | { foo = "="; } 8 | ({ bar = 13; } // { baz = 89; }) 9 | { foo = 42; bar = 33; } 10 | ] 11 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-concat-strings-sep-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval e).success) [ (builtins.concatStringsSep (builtins.throw "a") [ "" ]) (builtins.concatStringsSep "," (builtins.throw "a")) (builtins.concatStringsSep "," [ "a" (builtins.throw "a") ]) ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-partition-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval e).success) [ 2 | (builtins.partition (builtins.throw "a") [ "" ]) 3 | (builtins.partition (x: true) (builtins.throw "b")) 4 | (builtins.partition (_: builtins.throw "x") [ "" ]) 5 | ] 6 | -------------------------------------------------------------------------------- /nix-compat-derive-tests/tests/ui/deserialize_from_missing.stderr: -------------------------------------------------------------------------------- 1 | error[E0277]: the trait bound `Test: From` is not satisfied 2 | --> tests/ui/deserialize_from_missing.rs:4:14 3 | | 4 | 4 | #[nix(from = "u64")] 5 | | ^^^^^ the trait `From` is not implemented for `Test` 6 | -------------------------------------------------------------------------------- /eval/src/test_utils.rs: -------------------------------------------------------------------------------- 1 | use codemap::CodeMap; 2 | 3 | /// Create a dummy [`codemap::Span`] for use in tests 4 | pub(crate) fn dummy_span() -> codemap::Span { 5 | let mut codemap = CodeMap::new(); 6 | let file = codemap.add_file("".to_owned(), "".to_owned()); 7 | file.span 8 | } 9 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-zipAttrsWith.nix: -------------------------------------------------------------------------------- 1 | with import ./../lib.nix; 2 | 3 | let 4 | str = builtins.hashString "sha256" "test"; 5 | in 6 | builtins.zipAttrsWith 7 | (n: v: { inherit n v; }) 8 | (map (n: { ${builtins.substring n 1 str} = n; }) 9 | (range 0 31)) 10 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-foldlStrict-lazy-elements.nix: -------------------------------------------------------------------------------- 1 | # Tests that the rhs argument of op is not forced unconditionally 2 | let 3 | lst = builtins.foldl' 4 | (acc: x: acc ++ [ x ]) 5 | [ ] 6 | [ 42 (throw "this shouldn't be evaluated") ]; 7 | in 8 | 9 | builtins.head lst 10 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-with.nix: -------------------------------------------------------------------------------- 1 | let { 2 | 3 | a = "xyzzy"; 4 | 5 | as = { 6 | a = "foo"; 7 | b = "bar"; 8 | }; 9 | 10 | bs = { 11 | a = "bar"; 12 | }; 13 | 14 | x = with as; a + b; 15 | 16 | y = with as; with bs; a + b; 17 | 18 | body = x + y; 19 | } 20 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-floor-ceil.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | let 4 | n1 = builtins.floor 23.5; 5 | n2 = builtins.ceil 23.5; 6 | n3 = builtins.floor 23; 7 | n4 = builtins.ceil 23; 8 | in 9 | builtins.concatStringsSep ";" (map toString [ n1 n2 n3 n4 ]) 10 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-add-paths.nix: -------------------------------------------------------------------------------- 1 | [ 2 | (/bin + "/") 3 | (/bin + "bar") 4 | (let name = "bar"; in /bin + name) 5 | (let name = "bar"; in /bin + "${name}") 6 | (let name = "bar"; in /bin + "/" + "${name}") 7 | (let name = "bar"; in /bin + "/${name}") 8 | (/bin + /bin) 9 | ] 10 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-concatstringssep.nix: -------------------------------------------------------------------------------- 1 | with builtins; 2 | 3 | [ 4 | (concatStringsSep "" [ ]) 5 | (concatStringsSep "" [ "foo" "bar" "xyzzy" ]) 6 | (concatStringsSep ", " [ "foo" "bar" "xyzzy" ]) 7 | (concatStringsSep ", " [ "foo" ]) 8 | (concatStringsSep ", " [ ]) 9 | ] 10 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/notyetpassing/eval-okay-cycle-display-cppnix-2.13.exp: -------------------------------------------------------------------------------- 1 | [ { car = 42; cdr = «repeated»; } [ «repeated» «repeated» «repeated» ] { val = 42; wal = «repeated»; xal = «repeated»; } { tail1 = «repeated»; tail2 = «repeated»; val = 42; } { tail1 = «repeated»; tail2 = «repeated»; val = 21; } ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-getattr.nix: -------------------------------------------------------------------------------- 1 | [ 2 | (builtins.getAttr "foo" { foo = 1; bar = 2; baz = 3; }) 3 | (builtins.getAttr "bar" { foo = 1; bar = 2; baz = 3; }) 4 | (builtins.getAttr "baz" { foo = 1; bar = 2; baz = 3; }) 5 | (builtins.getAttr "foo" { foo = { bar = { baz = 3; }; }; }) 6 | ] 7 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-replaceStrings.nix: -------------------------------------------------------------------------------- 1 | [ 2 | (builtins.replaceStrings [ "oo" "a" ] [ "a" "i" ] "foobar") 3 | (builtins.replaceStrings [ "o" ] [ "a" ] "a") 4 | (builtins.replaceStrings [ "" "" ] [ "1" "2" ] "a") 5 | (builtins.replaceStrings [ "a" "b" "c" ] [ "A" "B" "C" ] "abc") 6 | ] 7 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-to-string-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval (builtins.toString e)).success) [ 2 | (builtins.throw "a") 3 | [ (builtins.throw "a") ] 4 | [ "abc" (builtins.throw "a") ] 5 | "abc${builtins.throw "c"}" 6 | # FIXME: test derivations and files. 7 | ] 8 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-tojson-tostring.nix: -------------------------------------------------------------------------------- 1 | # Attribute sets with a `__toString` attribute JSON-serialise with a 2 | # string coercion of the function call result. 3 | 4 | builtins.toJSON { 5 | __toString = self: "it's " + (builtins.toString (self.x * self.y)); 6 | x = 21; 7 | y = 2; 8 | } 9 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-dirof.nix: -------------------------------------------------------------------------------- 1 | [ 2 | (builtins.dirOf /foo/bar) 3 | (builtins.dirOf "foo") 4 | (builtins.dirOf "foo///") 5 | (builtins.dirOf "foo/bar") 6 | (builtins.dirOf "./.") 7 | (builtins.dirOf "") 8 | (builtins.dirOf /.) 9 | (builtins.toString (builtins.dirOf /.)) 10 | ] 11 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-attrs2.nix: -------------------------------------------------------------------------------- 1 | let { 2 | as = { x = 123; y = 456; } // { z = 789; } // { z = 987; }; 3 | 4 | A = "a"; 5 | Z = "z"; 6 | 7 | body = if builtins.hasAttr A as 8 | then builtins.getAttr A as 9 | else assert builtins.hasAttr Z as; builtins.getAttr Z as; 10 | } 11 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-fromjson-escapes.exp: -------------------------------------------------------------------------------- 1 | "quote \" reverse solidus \\ solidus / backspace  formfeed newline \n carriage return \r horizontal tab \t 1 char unicode encoded backspace  1 char unicode encoded e with accent é 2 char unicode encoded s with caron š 3 char unicode encoded rightwards arrow →" 2 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-pathexists.nix: -------------------------------------------------------------------------------- 1 | builtins.pathExists (builtins.toPath ./lib.nix) 2 | && builtins.pathExists (builtins.toPath (builtins.toString ./lib.nix)) 3 | && !builtins.pathExists (builtins.toPath (builtins.toString ./bla.nix)) 4 | && builtins.pathExists ./lib.nix 5 | && !builtins.pathExists ./bla.nix 6 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-fromjson-escapes.exp: -------------------------------------------------------------------------------- 1 | "quote \" reverse solidus \\ solidus / backspace  formfeed newline \n carriage return \r horizontal tab \t 1 char unicode encoded backspace  1 char unicode encoded e with accent é 2 char unicode encoded s with caron š 3 char unicode encoded rightwards arrow →" 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-nix-version-cmp.nix: -------------------------------------------------------------------------------- 1 | # nixpkgs checks against the `builtins.nixVersion` and fails if it 2 | # doesn't like what it sees. To work around this we have a "user-agent 3 | # style" version (see cl/6858) that ensures compatibility. 4 | 5 | builtins.compareVersions "2.18" builtins.nixVersion 6 | -------------------------------------------------------------------------------- /nix-compat-derive-tests/tests/ui/deserialize_missing_default.rs: -------------------------------------------------------------------------------- 1 | use nix_compat_derive::NixDeserialize; 2 | 3 | #[derive(NixDeserialize)] 4 | pub struct Value(String); 5 | 6 | #[derive(NixDeserialize)] 7 | pub struct Test { 8 | #[nix(version = "20..")] 9 | version: Value, 10 | } 11 | 12 | fn main() {} 13 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/README.md: -------------------------------------------------------------------------------- 1 | These test definitions are taken from the Nix 2.3 code base, they can 2 | be found upstream at: 3 | 4 | https://github.com/NixOS/nix/tree/2.3.16/tests/lang 5 | 6 | These tests follow the licensing directions of Nix 2.3 itself: 7 | 8 | https://github.com/NixOS/nix/blob/2.3.16/COPYING 9 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-builtins.nix: -------------------------------------------------------------------------------- 1 | assert builtins ? currentSystem; 2 | assert !builtins ? __currentSystem; 3 | 4 | let { 5 | 6 | x = if builtins ? dirOf then builtins.dirOf /foo/bar else ""; 7 | 8 | y = if builtins ? fnord then builtins.fnord "foo" else ""; 9 | 10 | body = x + y; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-tail-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval e).success) [ 2 | (builtins.tail (builtins.throw "a")) 3 | (builtins.tail [ (builtins.throw "a") ]) 4 | (builtins.tail [ (builtins.throw "a") "a" ]) 5 | (builtins.tail [ (builtins.throw "a") (builtins.throw "a") ]) 6 | ] 7 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/notyetpassing/eval-fail-builtins-genericClosure-uncomparable-keys.nix: -------------------------------------------------------------------------------- 1 | # Attribute sets can't be compared, only checked for equality 2 | builtins.genericClosure { 3 | startSet = [ 4 | { key = { foo = 21; }; } 5 | ]; 6 | operator = _: [ 7 | { key = { bar = 21; }; } 8 | ]; 9 | } 10 | -------------------------------------------------------------------------------- /nix-compat/src/wire/mod.rs: -------------------------------------------------------------------------------- 1 | //! Module parsing and emitting the wire format used by Nix, both in the 2 | //! nix-daemon protocol as well as in the NAR format. 3 | 4 | mod bytes; 5 | pub use bytes::*; 6 | 7 | mod protocol_version; 8 | pub use protocol_version::ProtocolVersion; 9 | 10 | pub mod de; 11 | pub mod ser; 12 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-fail-path-slash.nix: -------------------------------------------------------------------------------- 1 | # Trailing slashes in paths are not allowed. 2 | # This restriction could be lifted sometime, 3 | # for example if we make '/' a path concatenation operator. 4 | # See https://github.com/NixOS/nix/issues/1138 5 | # and https://nixos.org/nix-dev/2016-June/020829.html 6 | /nix/store/ 7 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-any-all.nix: -------------------------------------------------------------------------------- 1 | with builtins; 2 | 3 | [ (any (x: x == 1) []) 4 | (any (x: x == 1) [2 3 4]) 5 | (any (x: x == 1) [1 2 3 4]) 6 | (any (x: x == 1) [4 3 2 1]) 7 | (all (x: x == 1) []) 8 | (all (x: x == 1) [1]) 9 | (all (x: x == 1) [1 2 3]) 10 | (all (x: x == 1) [1 1 1]) 11 | ] 12 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/notyetpassing/eval-okay-path-antiquotation.nix: -------------------------------------------------------------------------------- 1 | let 2 | foo = "foo"; 3 | in 4 | { 5 | simple = ./${foo}; 6 | surrounded = ./a-${foo}-b; 7 | absolute = /${foo}; 8 | expr = ./${foo + "/bar"}; 9 | home = ~/${foo}; 10 | notfirst = ./bar/${foo}; 11 | slashes = /${foo}/${"bar"}; 12 | } 13 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-hashString.exp: -------------------------------------------------------------------------------- 1 | [ "8a0614b4eaa4cffb7515ec101847e198" "8bd218cf61321d8aa05b3602b99f90d2d8cef3d6" "80ac06d74cb6c5d14af718ce8c3c1255969a1a595b76a3cf92354a95331a879a" "0edac513b6b0454705b553deda4c9b055da0939d26d2f73548862817ebeac5378cf64ff7a752ce1a0590a736735d3bbd9e8a7f04d93617cdf514313f5ab5baa4" ] 2 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-type-of-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval (builtins.typeOf e)).success) [ 2 | (builtins.throw "a") 3 | { 4 | a = builtins.throw "b"; 5 | } 6 | [ (builtins.throw "c") ] 7 | (./xyz + (builtins.throw "p")) 8 | # FIXME: test derivations and files. 9 | ] 10 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-xml.nix: -------------------------------------------------------------------------------- 1 | rec { 2 | 3 | x = 123; 4 | 5 | y = 567.890; 6 | 7 | a = "foo"; 8 | 9 | b = "bar"; 10 | 11 | c = "foo" + "bar"; 12 | 13 | f = {z, x, y}: if y then x else z; 14 | 15 | id = x: x; 16 | 17 | at = args@{x, y, z}: x; 18 | 19 | ellipsis = {x, y, z, ...}: x; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /eval/src/tests/tvix_tests/eval-okay-builtins-sort-propagate-catchable.nix: -------------------------------------------------------------------------------- 1 | map (e: (builtins.tryEval e).success) [ 2 | (builtins.sort (builtins.throw "a") [ "" ]) 3 | (builtins.sort (x: y: true) (builtins.throw "b")) 4 | (builtins.sort (_: _: builtins.throw "x") [ "" ]) 5 | (builtins.sort (_: _: builtins.throw "x") [ "" "" ]) 6 | ] 7 | -------------------------------------------------------------------------------- /nix-compat/src/nixcpp/mod.rs: -------------------------------------------------------------------------------- 1 | //! Contains code parsing some of the Nixcpp config files etc. 2 | //! left by Nix *on the local disk*. 3 | //! 4 | //! This is only for Nix' own state/config. 5 | //! 6 | //! More "standardized" protocols, like parts of the Nix HTTP Binary Cache 7 | //! protocol live elsewhere. 8 | 9 | pub mod conf; 10 | -------------------------------------------------------------------------------- /serde/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! `tvix-serde` implements (de-)serialisation of Rust data structures 2 | //! to/from Nix. This is intended to make it easy to use Nix as as 3 | //! configuration language. 4 | 5 | mod de; 6 | mod error; 7 | 8 | pub use de::from_str; 9 | pub use de::from_str_with_config; 10 | 11 | #[cfg(test)] 12 | mod de_tests; 13 | -------------------------------------------------------------------------------- /workspace.josh: -------------------------------------------------------------------------------- 1 | :/third_party:[ 2 | ::nixpkgs/, 3 | ::sources/ 4 | ] 5 | ::tvix:exclude[ 6 | ::tvix/default.nix 7 | ::tvix/**/default.nix:exclude[::tvix/eval/src/tests/tvix_tests/directory/default.nix] 8 | ]:/tvix 9 | ::third_party/overlays/patches/cbtemulator-uds.patch:/third_party/overlays/patches:prefix=nixpkgs 10 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/parse-okay-crlf.nix: -------------------------------------------------------------------------------- 1 | rec { 2 | 3 | /* Dit is 4 | een test. */ 5 | 6 | x = 7 | # Dit is een test. y; 8 | 9 | y = 123; 10 | 11 | # CR or CR/LF (but not explicit \r's) in strings should be 12 | # translated to LF. 13 | foo = "multi line 14 | string 15 | test\r"; 16 | 17 | z = 456; } 18 | -------------------------------------------------------------------------------- /eval/src/tests/nix_tests/eval-okay-toxml2.exp: -------------------------------------------------------------------------------- 1 | "\n\n \n \n \n \n \n \n \n \n \n \n \n \n\n" 2 | --------------------------------------------------------------------------------