├── .clang-format ├── .clang-tidy ├── .dir-locals.el ├── .editorconfig ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ ├── installer.md │ └── missing_documentation.md ├── PULL_REQUEST_TEMPLATE.md ├── STALE-BOT.md ├── dependabot.yml ├── labeler.yml ├── stale.yml └── workflows │ ├── ci.yml │ └── labels.yml ├── .gitignore ├── .mergify.yml ├── .shellcheckrc ├── .version ├── CITATION.cff ├── CONTRIBUTING.md ├── COPYING ├── HACKING.md ├── README.md ├── contrib └── stack-collapse.py ├── default.nix ├── doc └── manual │ ├── .version │ ├── anchors.jq │ ├── book.toml.in │ ├── custom.css │ ├── generate-builtins.nix │ ├── generate-deps.py │ ├── generate-manpage.nix │ ├── generate-settings.nix │ ├── generate-store-info.nix │ ├── generate-store-types.nix │ ├── generate-xp-features-shortlist.nix │ ├── generate-xp-features.nix │ ├── meson.build │ ├── package.nix │ ├── quote-literals.xsl │ ├── redirects.js │ ├── remove_before_wrapper.py │ ├── render-manpage.sh │ ├── rl-next │ ├── config │ ├── deprecate__json.md │ ├── eval-profiler.md │ ├── json-logger.md │ ├── nix-profile-add.md │ ├── outpath-and-sourceinfo-fixes.md │ └── revert-77.md │ ├── source │ ├── SUMMARY.md.in │ ├── _redirects │ ├── advanced-topics │ │ ├── cores-vs-jobs.md │ │ ├── diff-hook.md │ │ ├── distributed-builds.md │ │ ├── eval-profiler.md │ │ ├── index.md │ │ └── post-build-hook.md │ ├── architecture │ │ └── architecture.md │ ├── c-api.md │ ├── command-ref │ │ ├── conf-file-prefix.md │ │ ├── env-common.md │ │ ├── experimental-commands.md │ │ ├── files.md │ │ ├── files │ │ │ ├── channels.md │ │ │ ├── default-nix-expression.md │ │ │ ├── manifest.json.md │ │ │ ├── manifest.nix.md │ │ │ └── profiles.md │ │ ├── index.md │ │ ├── main-commands.md │ │ ├── meson.build │ │ ├── nix-build.md │ │ ├── nix-channel.md │ │ ├── nix-collect-garbage.md │ │ ├── nix-copy-closure.md │ │ ├── nix-daemon.md │ │ ├── nix-env.md │ │ ├── nix-env │ │ │ ├── delete-generations.md │ │ │ ├── env-common.md │ │ │ ├── install.md │ │ │ ├── list-generations.md │ │ │ ├── opt-common.md │ │ │ ├── query.md │ │ │ ├── rollback.md │ │ │ ├── set-flag.md │ │ │ ├── set.md │ │ │ ├── switch-generation.md │ │ │ ├── switch-profile.md │ │ │ ├── uninstall.md │ │ │ └── upgrade.md │ │ ├── nix-hash.md │ │ ├── nix-instantiate.md │ │ ├── nix-prefetch-url.md │ │ ├── nix-shell.md │ │ ├── nix-store.md │ │ ├── nix-store │ │ │ ├── add-fixed.md │ │ │ ├── add.md │ │ │ ├── delete.md │ │ │ ├── dump-db.md │ │ │ ├── dump.md │ │ │ ├── export.md │ │ │ ├── gc.md │ │ │ ├── generate-binary-cache-key.md │ │ │ ├── import.md │ │ │ ├── load-db.md │ │ │ ├── opt-common.md │ │ │ ├── optimise.md │ │ │ ├── print-env.md │ │ │ ├── query.md │ │ │ ├── read-log.md │ │ │ ├── realise.md │ │ │ ├── repair-path.md │ │ │ ├── restore.md │ │ │ ├── serve.md │ │ │ ├── verify-path.md │ │ │ └── verify.md │ │ ├── opt-common.md │ │ ├── status-build-failure.md │ │ └── utilities.md │ ├── development │ │ ├── building.md │ │ ├── cli-guideline.md │ │ ├── contributing.md │ │ ├── cxx.md │ │ ├── debugging.md │ │ ├── documentation.md │ │ ├── experimental-features.md │ │ ├── index.md │ │ ├── json-guideline.md │ │ ├── meson.build │ │ └── testing.md │ ├── favicon.png │ ├── favicon.svg │ ├── figures │ │ ├── user-environments.png │ │ └── user-environments.sxd │ ├── glossary.md │ ├── installation │ │ ├── building-source.md │ │ ├── env-variables.md │ │ ├── index.md │ │ ├── installing-binary.md │ │ ├── installing-docker.md │ │ ├── installing-source.md │ │ ├── multi-user.md │ │ ├── nix-security.md │ │ ├── obtaining-source.md │ │ ├── prerequisites-source.md │ │ ├── single-user.md │ │ ├── supported-platforms.md │ │ ├── uninstall.md │ │ └── upgrading.md │ ├── introduction.md │ ├── language │ │ ├── advanced-attributes.md │ │ ├── builtins-prefix.md │ │ ├── builtins-suffix.md │ │ ├── constructs.md │ │ ├── constructs │ │ │ └── lookup-path.md │ │ ├── derivations.md │ │ ├── evaluation.md │ │ ├── identifiers.md │ │ ├── import-from-derivation.md │ │ ├── index.md │ │ ├── meson.build │ │ ├── operators.md │ │ ├── scope.md │ │ ├── string-context.md │ │ ├── string-interpolation.md │ │ ├── string-literals.md │ │ ├── syntax.md │ │ ├── types.md │ │ ├── values.md │ │ └── variables.md │ ├── meson.build │ ├── package-management │ │ ├── binary-cache-substituter.md │ │ ├── garbage-collection.md │ │ ├── garbage-collector-roots.md │ │ ├── index.md │ │ ├── profiles.md │ │ ├── sharing-packages.md │ │ └── ssh-substituter.md │ ├── protocols │ │ ├── derivation-aterm.md │ │ ├── index.md │ │ ├── json │ │ │ ├── derivation.md │ │ │ ├── index.md │ │ │ └── store-object-info.md │ │ ├── nix-archive.md │ │ ├── store-path.md │ │ └── tarball-fetcher.md │ ├── quick-start.md │ ├── release-notes │ │ ├── index.md │ │ ├── meson.build │ │ ├── rl-0.10.1.md │ │ ├── rl-0.10.md │ │ ├── rl-0.11.md │ │ ├── rl-0.12.md │ │ ├── rl-0.13.md │ │ ├── rl-0.14.md │ │ ├── rl-0.15.md │ │ ├── rl-0.16.md │ │ ├── rl-0.5.md │ │ ├── rl-0.6.md │ │ ├── rl-0.7.md │ │ ├── rl-0.8.1.md │ │ ├── rl-0.8.md │ │ ├── rl-0.9.1.md │ │ ├── rl-0.9.2.md │ │ ├── rl-0.9.md │ │ ├── rl-1.0.md │ │ ├── rl-1.1.md │ │ ├── rl-1.10.md │ │ ├── rl-1.11.10.md │ │ ├── rl-1.11.md │ │ ├── rl-1.2.md │ │ ├── rl-1.3.md │ │ ├── rl-1.4.md │ │ ├── rl-1.5.1.md │ │ ├── rl-1.5.2.md │ │ ├── rl-1.5.md │ │ ├── rl-1.6.1.md │ │ ├── rl-1.6.md │ │ ├── rl-1.7.md │ │ ├── rl-1.8.md │ │ ├── rl-1.9.md │ │ ├── rl-2.0.md │ │ ├── rl-2.1.md │ │ ├── rl-2.10.md │ │ ├── rl-2.11.md │ │ ├── rl-2.12.md │ │ ├── rl-2.13.md │ │ ├── rl-2.14.md │ │ ├── rl-2.15.md │ │ ├── rl-2.16.md │ │ ├── rl-2.17.md │ │ ├── rl-2.18.md │ │ ├── rl-2.19.md │ │ ├── rl-2.2.md │ │ ├── rl-2.20.md │ │ ├── rl-2.21.md │ │ ├── rl-2.22.md │ │ ├── rl-2.23.md │ │ ├── rl-2.24.md │ │ ├── rl-2.25.md │ │ ├── rl-2.26.md │ │ ├── rl-2.27.md │ │ ├── rl-2.28.md │ │ ├── rl-2.29.md │ │ ├── rl-2.3.md │ │ ├── rl-2.4.md │ │ ├── rl-2.5.md │ │ ├── rl-2.6.md │ │ ├── rl-2.7.md │ │ ├── rl-2.8.md │ │ └── rl-2.9.md │ └── store │ │ ├── building.md │ │ ├── derivation │ │ ├── index.md │ │ └── outputs │ │ │ ├── content-address.md │ │ │ ├── index.md │ │ │ └── input-address.md │ │ ├── file-system-object.md │ │ ├── file-system-object │ │ └── content-address.md │ │ ├── index.md │ │ ├── meson.build │ │ ├── store-object.md │ │ ├── store-object │ │ └── content-address.md │ │ ├── store-path.md │ │ └── types │ │ └── index.md.in │ ├── substitute.py │ ├── theme │ └── highlight.js │ └── utils.nix ├── docker.nix ├── flake.lock ├── flake.nix ├── maintainers ├── README.md ├── backporting.md ├── data │ ├── release-credits-email-to-handle.json │ └── release-credits-handle-to-name.json ├── flake-module.nix ├── format.sh ├── onboarding.md ├── release-credits ├── release-notes ├── release-process.md ├── security-reports.md └── upload-release.pl ├── meson.build ├── meson.options ├── misc ├── bash │ ├── completion.sh │ └── meson.build ├── fish │ ├── completion.fish │ └── meson.build ├── launchd │ ├── meson.build │ └── org.nixos.nix-daemon.plist.in ├── meson.build ├── systemd │ ├── meson.build │ ├── nix-daemon.conf.in │ ├── nix-daemon.service.in │ └── nix-daemon.socket.in ├── systemv │ └── nix-daemon ├── upstart │ └── nix-daemon.conf.in └── zsh │ ├── completion.zsh │ ├── meson.build │ └── run-help-nix ├── nix-meson-build-support ├── big-objs │ └── meson.build ├── common │ └── meson.build ├── deps-lists │ └── meson.build ├── export-all-symbols │ └── meson.build ├── export │ └── meson.build ├── generate-header │ └── meson.build ├── libatomic │ └── meson.build ├── subprojects │ └── meson.build └── windows-version │ └── meson.build ├── packaging ├── binary-tarball.nix ├── components.nix ├── dependencies.nix ├── dev-shell.nix ├── everything.nix ├── hydra.nix ├── installer │ ├── default.nix │ └── install.in └── patches │ ├── libgit2-mempack-thin-packfile.patch │ └── libgit2-packbuilder-callback-interruptible.patch ├── scripts ├── bigsur-nixbld-user-migration.sh ├── build-checks ├── create-darwin-volume.sh ├── install-darwin-multi-user.sh ├── install-multi-user.sh ├── install-nix-from-tarball.sh ├── install-systemd-multi-user.sh ├── meson.build ├── nix-profile-daemon.fish.in ├── nix-profile-daemon.sh.in ├── nix-profile.fish.in ├── nix-profile.sh.in ├── prepare-installer-for-github-actions ├── sequoia-nixbld-user-migration.sh └── serve-installer-for-github-actions ├── shell.nix ├── src ├── build-remote │ └── build-remote.cc ├── external-api-docs │ ├── .gitignore │ ├── .version │ ├── README.md │ ├── doxygen.cfg.in │ ├── meson.build │ └── package.nix ├── internal-api-docs │ ├── .gitignore │ ├── .version │ ├── doxygen.cfg.in │ ├── meson.build │ └── package.nix ├── libcmd │ ├── .version │ ├── built-path.cc │ ├── command-installable-value.cc │ ├── command.cc │ ├── common-eval-args.cc │ ├── editor-for.cc │ ├── include │ │ └── nix │ │ │ └── cmd │ │ │ ├── built-path.hh │ │ │ ├── command-installable-value.hh │ │ │ ├── command.hh │ │ │ ├── common-eval-args.hh │ │ │ ├── compatibility-settings.hh │ │ │ ├── editor-for.hh │ │ │ ├── installable-attr-path.hh │ │ │ ├── installable-derived-path.hh │ │ │ ├── installable-flake.hh │ │ │ ├── installable-value.hh │ │ │ ├── installables.hh │ │ │ ├── legacy.hh │ │ │ ├── markdown.hh │ │ │ ├── meson.build │ │ │ ├── misc-store-flags.hh │ │ │ ├── network-proxy.hh │ │ │ ├── repl-interacter.hh │ │ │ └── repl.hh │ ├── installable-attr-path.cc │ ├── installable-derived-path.cc │ ├── installable-flake.cc │ ├── installable-value.cc │ ├── installables.cc │ ├── markdown.cc │ ├── meson.build │ ├── meson.options │ ├── misc-store-flags.cc │ ├── network-proxy.cc │ ├── nix-meson-build-support │ ├── package.nix │ ├── repl-interacter.cc │ └── repl.cc ├── libexpr-c │ ├── .version │ ├── meson.build │ ├── nix-meson-build-support │ ├── nix_api_expr.cc │ ├── nix_api_expr.h │ ├── nix_api_expr_internal.h │ ├── nix_api_external.cc │ ├── nix_api_external.h │ ├── nix_api_value.cc │ ├── nix_api_value.h │ └── package.nix ├── libexpr-test-support │ ├── .version │ ├── include │ │ └── nix │ │ │ └── expr │ │ │ └── tests │ │ │ ├── libexpr.hh │ │ │ ├── meson.build │ │ │ ├── nix_api_expr.hh │ │ │ └── value │ │ │ └── context.hh │ ├── meson.build │ ├── nix-meson-build-support │ ├── package.nix │ └── tests │ │ └── value │ │ └── context.cc ├── libexpr-tests │ ├── .version │ ├── data │ │ └── .gitkeep │ ├── derived-path.cc │ ├── error_traces.cc │ ├── eval.cc │ ├── json.cc │ ├── main.cc │ ├── meson.build │ ├── nix-meson-build-support │ ├── nix_api_expr.cc │ ├── nix_api_external.cc │ ├── nix_api_value.cc │ ├── package.nix │ ├── primops.cc │ ├── search-path.cc │ ├── trivial.cc │ └── value │ │ ├── context.cc │ │ ├── print.cc │ │ └── value.cc ├── libexpr │ ├── .version │ ├── attr-path.cc │ ├── attr-set.cc │ ├── eval-cache.cc │ ├── eval-error.cc │ ├── eval-gc.cc │ ├── eval-profiler-settings.cc │ ├── eval-profiler.cc │ ├── eval-settings.cc │ ├── eval.cc │ ├── fetchurl.nix │ ├── function-trace.cc │ ├── get-drvs.cc │ ├── imported-drv-to-derivation.nix │ ├── include │ │ └── nix │ │ │ └── expr │ │ │ ├── attr-path.hh │ │ │ ├── attr-set.hh │ │ │ ├── eval-cache.hh │ │ │ ├── eval-error.hh │ │ │ ├── eval-gc.hh │ │ │ ├── eval-inline.hh │ │ │ ├── eval-profiler-settings.hh │ │ │ ├── eval-profiler.hh │ │ │ ├── eval-settings.hh │ │ │ ├── eval.hh │ │ │ ├── function-trace.hh │ │ │ ├── gc-small-vector.hh │ │ │ ├── get-drvs.hh │ │ │ ├── json-to-value.hh │ │ │ ├── meson.build │ │ │ ├── nixexpr.hh │ │ │ ├── parser-state.hh │ │ │ ├── primops.hh │ │ │ ├── print-ambiguous.hh │ │ │ ├── print-options.hh │ │ │ ├── print.hh │ │ │ ├── repl-exit-status.hh │ │ │ ├── search-path.hh │ │ │ ├── symbol-table.hh │ │ │ ├── value-to-json.hh │ │ │ ├── value-to-xml.hh │ │ │ ├── value.hh │ │ │ └── value │ │ │ └── context.hh │ ├── json-to-value.cc │ ├── lexer-helpers.cc │ ├── lexer-helpers.hh │ ├── lexer.l │ ├── meson.build │ ├── meson.options │ ├── nix-meson-build-support │ ├── nixexpr.cc │ ├── package.nix │ ├── parser.y │ ├── paths.cc │ ├── primops.cc │ ├── primops │ │ ├── context.cc │ │ ├── derivation.nix │ │ ├── fetchClosure.cc │ │ ├── fetchMercurial.cc │ │ ├── fetchTree.cc │ │ ├── fromTOML.cc │ │ └── meson.build │ ├── print-ambiguous.cc │ ├── print.cc │ ├── search-path.cc │ ├── value-to-json.cc │ ├── value-to-xml.cc │ └── value │ │ └── context.cc ├── libfetchers-c │ ├── .version │ ├── meson.build │ ├── nix-meson-build-support │ ├── nix_api_fetchers.cc │ ├── nix_api_fetchers.h │ ├── nix_api_fetchers_internal.hh │ └── package.nix ├── libfetchers-tests │ ├── .version │ ├── access-tokens.cc │ ├── data │ │ └── public-key │ │ │ ├── defaultType.json │ │ │ ├── noRoundTrip.json │ │ │ └── simple.json │ ├── git-utils.cc │ ├── meson.build │ ├── nix-meson-build-support │ ├── nix_api_fetchers.cc │ ├── package.nix │ └── public-key.cc ├── libfetchers │ ├── .version │ ├── attrs.cc │ ├── cache.cc │ ├── fetch-settings.cc │ ├── fetch-to-store.cc │ ├── fetchers.cc │ ├── filtering-source-accessor.cc │ ├── git-lfs-fetch.cc │ ├── git-utils.cc │ ├── git.cc │ ├── github.cc │ ├── include │ │ └── nix │ │ │ └── fetchers │ │ │ ├── attrs.hh │ │ │ ├── cache.hh │ │ │ ├── fetch-settings.hh │ │ │ ├── fetch-to-store.hh │ │ │ ├── fetchers.hh │ │ │ ├── filtering-source-accessor.hh │ │ │ ├── git-lfs-fetch.hh │ │ │ ├── git-utils.hh │ │ │ ├── input-cache.hh │ │ │ ├── meson.build │ │ │ ├── registry.hh │ │ │ ├── store-path-accessor.hh │ │ │ └── tarball.hh │ ├── indirect.cc │ ├── input-cache.cc │ ├── mercurial.cc │ ├── meson.build │ ├── nix-meson-build-support │ ├── package.nix │ ├── path.cc │ ├── registry.cc │ ├── store-path-accessor.cc │ └── tarball.cc ├── libflake-c │ ├── .version │ ├── meson.build │ ├── nix-meson-build-support │ ├── nix_api_flake.cc │ ├── nix_api_flake.h │ ├── nix_api_flake_internal.hh │ └── package.nix ├── libflake-tests │ ├── .version │ ├── data │ │ └── .gitkeep │ ├── flakeref.cc │ ├── meson.build │ ├── nix-meson-build-support │ ├── nix_api_flake.cc │ ├── package.nix │ └── url-name.cc ├── libflake │ ├── .version │ ├── call-flake.nix │ ├── config.cc │ ├── flake-primops.cc │ ├── flake.cc │ ├── flakeref.cc │ ├── include │ │ └── nix │ │ │ └── flake │ │ │ ├── flake-primops.hh │ │ │ ├── flake.hh │ │ │ ├── flakeref.hh │ │ │ ├── lockfile.hh │ │ │ ├── meson.build │ │ │ ├── settings.hh │ │ │ └── url-name.hh │ ├── lockfile.cc │ ├── meson.build │ ├── nix-meson-build-support │ ├── package.nix │ ├── settings.cc │ └── url-name.cc ├── libmain-c │ ├── .version │ ├── meson.build │ ├── nix-meson-build-support │ ├── nix_api_main.cc │ ├── nix_api_main.h │ └── package.nix ├── libmain │ ├── .version │ ├── common-args.cc │ ├── include │ │ └── nix │ │ │ └── main │ │ │ ├── common-args.hh │ │ │ ├── loggers.hh │ │ │ ├── meson.build │ │ │ ├── plugin.hh │ │ │ ├── progress-bar.hh │ │ │ └── shared.hh │ ├── loggers.cc │ ├── meson.build │ ├── nix-meson-build-support │ ├── package.nix │ ├── plugin.cc │ ├── progress-bar.cc │ ├── shared.cc │ └── unix │ │ └── stack.cc ├── libstore-c │ ├── .version │ ├── meson.build │ ├── nix-meson-build-support │ ├── nix_api_store.cc │ ├── nix_api_store.h │ ├── nix_api_store_internal.h │ └── package.nix ├── libstore-test-support │ ├── .version │ ├── derived-path.cc │ ├── include │ │ └── nix │ │ │ └── store │ │ │ └── tests │ │ │ ├── derived-path.hh │ │ │ ├── libstore.hh │ │ │ ├── meson.build │ │ │ ├── nix_api_store.hh │ │ │ ├── outputs-spec.hh │ │ │ ├── path.hh │ │ │ └── protocol.hh │ ├── meson.build │ ├── nix-meson-build-support │ ├── outputs-spec.cc │ ├── package.nix │ └── path.cc ├── libstore-tests │ ├── .version │ ├── common-protocol.cc │ ├── content-address.cc │ ├── data │ │ ├── common-protocol │ │ │ ├── content-address.bin │ │ │ ├── drv-output.bin │ │ │ ├── optional-content-address.bin │ │ │ ├── optional-store-path.bin │ │ │ ├── realisation.bin │ │ │ ├── set.bin │ │ │ ├── store-path.bin │ │ │ ├── string.bin │ │ │ └── vector.bin │ │ ├── derivation │ │ │ ├── bad-old-version-dyn-deps.drv │ │ │ ├── bad-version.drv │ │ │ ├── ca │ │ │ │ ├── advanced-attributes-defaults.drv │ │ │ │ ├── advanced-attributes-defaults.json │ │ │ │ ├── advanced-attributes-structured-attrs-defaults.drv │ │ │ │ ├── advanced-attributes-structured-attrs-defaults.json │ │ │ │ ├── advanced-attributes-structured-attrs.drv │ │ │ │ ├── advanced-attributes-structured-attrs.json │ │ │ │ ├── advanced-attributes.drv │ │ │ │ └── advanced-attributes.json │ │ │ ├── dynDerivationDeps.drv │ │ │ ├── dynDerivationDeps.json │ │ │ ├── ia │ │ │ │ ├── advanced-attributes-defaults.drv │ │ │ │ ├── advanced-attributes-defaults.json │ │ │ │ ├── advanced-attributes-structured-attrs-defaults.drv │ │ │ │ ├── advanced-attributes-structured-attrs-defaults.json │ │ │ │ ├── advanced-attributes-structured-attrs.drv │ │ │ │ ├── advanced-attributes-structured-attrs.json │ │ │ │ ├── advanced-attributes.drv │ │ │ │ └── advanced-attributes.json │ │ │ ├── output-caFixedFlat.json │ │ │ ├── output-caFixedNAR.json │ │ │ ├── output-caFixedText.json │ │ │ ├── output-caFloating.json │ │ │ ├── output-deferred.json │ │ │ ├── output-impure.json │ │ │ ├── output-inputAddressed.json │ │ │ ├── simple.drv │ │ │ └── simple.json │ │ ├── machines │ │ │ ├── bad_format │ │ │ └── valid │ │ ├── nar-info │ │ │ ├── impure.json │ │ │ └── pure.json │ │ ├── path-info │ │ │ ├── empty_impure.json │ │ │ ├── empty_pure.json │ │ │ ├── impure.json │ │ │ └── pure.json │ │ ├── serve-protocol │ │ │ ├── build-options-2.1.bin │ │ │ ├── build-options-2.2.bin │ │ │ ├── build-options-2.3.bin │ │ │ ├── build-options-2.7.bin │ │ │ ├── build-result-2.2.bin │ │ │ ├── build-result-2.3.bin │ │ │ ├── build-result-2.6.bin │ │ │ ├── content-address.bin │ │ │ ├── drv-output.bin │ │ │ ├── handshake-to-client.bin │ │ │ ├── optional-content-address.bin │ │ │ ├── optional-store-path.bin │ │ │ ├── realisation.bin │ │ │ ├── set.bin │ │ │ ├── store-path.bin │ │ │ ├── string.bin │ │ │ ├── unkeyed-valid-path-info-2.3.bin │ │ │ ├── unkeyed-valid-path-info-2.4.bin │ │ │ └── vector.bin │ │ ├── store-reference │ │ │ ├── auto.txt │ │ │ ├── auto_param.txt │ │ │ ├── local_1.txt │ │ │ ├── local_2.txt │ │ │ ├── local_shorthand_1.txt │ │ │ ├── local_shorthand_2.txt │ │ │ ├── ssh.txt │ │ │ ├── unix.txt │ │ │ └── unix_shorthand.txt │ │ └── worker-protocol │ │ │ ├── build-mode.bin │ │ │ ├── build-result-1.27.bin │ │ │ ├── build-result-1.28.bin │ │ │ ├── build-result-1.29.bin │ │ │ ├── build-result-1.37.bin │ │ │ ├── client-handshake-info_1_30.bin │ │ │ ├── client-handshake-info_1_33.bin │ │ │ ├── client-handshake-info_1_35.bin │ │ │ ├── content-address.bin │ │ │ ├── derived-path-1.29.bin │ │ │ ├── derived-path-1.30.bin │ │ │ ├── drv-output.bin │ │ │ ├── handshake-to-client.bin │ │ │ ├── keyed-build-result-1.29.bin │ │ │ ├── optional-content-address.bin │ │ │ ├── optional-store-path.bin │ │ │ ├── optional-trusted-flag.bin │ │ │ ├── realisation.bin │ │ │ ├── set.bin │ │ │ ├── store-path.bin │ │ │ ├── string.bin │ │ │ ├── unkeyed-valid-path-info-1.15.bin │ │ │ ├── valid-path-info-1.15.bin │ │ │ ├── valid-path-info-1.16.bin │ │ │ └── vector.bin │ ├── derivation-advanced-attrs.cc │ ├── derivation.cc │ ├── derived-path.cc │ ├── downstream-placeholder.cc │ ├── http-binary-cache-store.cc │ ├── legacy-ssh-store.cc │ ├── local-binary-cache-store.cc │ ├── local-overlay-store.cc │ ├── local-store.cc │ ├── machines.cc │ ├── meson.build │ ├── nar-info-disk-cache.cc │ ├── nar-info.cc │ ├── nix-meson-build-support │ ├── nix_api_store.cc │ ├── outputs-spec.cc │ ├── package.nix │ ├── path-info.cc │ ├── path.cc │ ├── references.cc │ ├── s3-binary-cache-store.cc │ ├── serve-protocol.cc │ ├── ssh-store.cc │ ├── store-reference.cc │ ├── uds-remote-store.cc │ └── worker-protocol.cc ├── libstore │ ├── .version │ ├── binary-cache-store.cc │ ├── build-result.cc │ ├── build │ │ ├── derivation-building-goal.cc │ │ ├── derivation-goal.cc │ │ ├── drv-output-substitution-goal.cc │ │ ├── entry-points.cc │ │ ├── goal.cc │ │ ├── substitution-goal.cc │ │ └── worker.cc │ ├── builtins │ │ ├── buildenv.cc │ │ ├── fetchurl.cc │ │ └── unpack-channel.cc │ ├── ca-specific-schema.sql │ ├── common-protocol.cc │ ├── common-ssh-store-config.cc │ ├── content-address.cc │ ├── daemon.cc │ ├── derivation-options.cc │ ├── derivations.cc │ ├── derived-path-map.cc │ ├── derived-path.cc │ ├── downstream-placeholder.cc │ ├── dummy-store.cc │ ├── dummy-store.md │ ├── export-import.cc │ ├── filetransfer.cc │ ├── gc.cc │ ├── globals.cc │ ├── http-binary-cache-store.cc │ ├── http-binary-cache-store.md │ ├── include │ │ └── nix │ │ │ └── store │ │ │ ├── binary-cache-store.hh │ │ │ ├── build-result.hh │ │ │ ├── build │ │ │ ├── derivation-building-goal.hh │ │ │ ├── derivation-building-misc.hh │ │ │ ├── derivation-goal.hh │ │ │ ├── drv-output-substitution-goal.hh │ │ │ ├── goal.hh │ │ │ ├── substitution-goal.hh │ │ │ └── worker.hh │ │ │ ├── builtins.hh │ │ │ ├── builtins │ │ │ └── buildenv.hh │ │ │ ├── common-protocol-impl.hh │ │ │ ├── common-protocol.hh │ │ │ ├── common-ssh-store-config.hh │ │ │ ├── content-address.hh │ │ │ ├── daemon.hh │ │ │ ├── derivation-options.hh │ │ │ ├── derivations.hh │ │ │ ├── derived-path-map.hh │ │ │ ├── derived-path.hh │ │ │ ├── downstream-placeholder.hh │ │ │ ├── filetransfer.hh │ │ │ ├── gc-store.hh │ │ │ ├── globals.hh │ │ │ ├── http-binary-cache-store.hh │ │ │ ├── indirect-root-store.hh │ │ │ ├── keys.hh │ │ │ ├── legacy-ssh-store.hh │ │ │ ├── length-prefixed-protocol-helper.hh │ │ │ ├── local-binary-cache-store.hh │ │ │ ├── local-fs-store.hh │ │ │ ├── local-overlay-store.hh │ │ │ ├── local-store.hh │ │ │ ├── log-store.hh │ │ │ ├── machines.hh │ │ │ ├── make-content-addressed.hh │ │ │ ├── meson.build │ │ │ ├── names.hh │ │ │ ├── nar-accessor.hh │ │ │ ├── nar-info-disk-cache.hh │ │ │ ├── nar-info.hh │ │ │ ├── outputs-spec.hh │ │ │ ├── parsed-derivations.hh │ │ │ ├── path-info.hh │ │ │ ├── path-references.hh │ │ │ ├── path-regex.hh │ │ │ ├── path-with-outputs.hh │ │ │ ├── path.hh │ │ │ ├── pathlocks.hh │ │ │ ├── posix-fs-canonicalise.hh │ │ │ ├── profiles.hh │ │ │ ├── realisation.hh │ │ │ ├── remote-fs-accessor.hh │ │ │ ├── remote-store-connection.hh │ │ │ ├── remote-store.hh │ │ │ ├── restricted-store.hh │ │ │ ├── s3-binary-cache-store.hh │ │ │ ├── s3.hh │ │ │ ├── serve-protocol-connection.hh │ │ │ ├── serve-protocol-impl.hh │ │ │ ├── serve-protocol.hh │ │ │ ├── sqlite.hh │ │ │ ├── ssh-store.hh │ │ │ ├── ssh.hh │ │ │ ├── store-api.hh │ │ │ ├── store-cast.hh │ │ │ ├── store-dir-config.hh │ │ │ ├── store-open.hh │ │ │ ├── store-reference.hh │ │ │ ├── store-registration.hh │ │ │ ├── uds-remote-store.hh │ │ │ ├── worker-protocol-connection.hh │ │ │ ├── worker-protocol-impl.hh │ │ │ └── worker-protocol.hh │ ├── indirect-root-store.cc │ ├── keys.cc │ ├── legacy-ssh-store.cc │ ├── legacy-ssh-store.md │ ├── linux │ │ ├── fchmodat2-compat.hh │ │ ├── include │ │ │ └── nix │ │ │ │ └── store │ │ │ │ ├── meson.build │ │ │ │ └── personality.hh │ │ ├── meson.build │ │ └── personality.cc │ ├── local-binary-cache-store.cc │ ├── local-binary-cache-store.md │ ├── local-fs-store.cc │ ├── local-overlay-store.cc │ ├── local-overlay-store.md │ ├── local-store.cc │ ├── local-store.md │ ├── log-store.cc │ ├── machines.cc │ ├── make-content-addressed.cc │ ├── meson.build │ ├── meson.options │ ├── misc.cc │ ├── mounted-ssh-store.md │ ├── names.cc │ ├── nar-accessor.cc │ ├── nar-info-disk-cache.cc │ ├── nar-info.cc │ ├── nix-meson-build-support │ ├── optimise-store.cc │ ├── outputs-spec.cc │ ├── package.nix │ ├── parsed-derivations.cc │ ├── path-info.cc │ ├── path-references.cc │ ├── path-with-outputs.cc │ ├── path.cc │ ├── pathlocks.cc │ ├── posix-fs-canonicalise.cc │ ├── profiles.cc │ ├── realisation.cc │ ├── remote-fs-accessor.cc │ ├── remote-store.cc │ ├── restricted-store.cc │ ├── s3-binary-cache-store.cc │ ├── s3-binary-cache-store.md │ ├── schema.sql │ ├── serve-protocol-connection.cc │ ├── serve-protocol.cc │ ├── sqlite.cc │ ├── ssh-store.cc │ ├── ssh-store.md │ ├── ssh.cc │ ├── store-api.cc │ ├── store-dir-config.cc │ ├── store-reference.cc │ ├── store-registration.cc │ ├── uds-remote-store.cc │ ├── uds-remote-store.md │ ├── unix │ │ ├── build │ │ │ ├── child.cc │ │ │ ├── darwin-derivation-builder.cc │ │ │ ├── derivation-builder.cc │ │ │ ├── hook-instance.cc │ │ │ ├── linux-derivation-builder.cc │ │ │ ├── sandbox-defaults.sb │ │ │ ├── sandbox-minimal.sb │ │ │ └── sandbox-network.sb │ │ ├── include │ │ │ └── nix │ │ │ │ └── store │ │ │ │ ├── build │ │ │ │ ├── child.hh │ │ │ │ ├── derivation-builder.hh │ │ │ │ └── hook-instance.hh │ │ │ │ ├── meson.build │ │ │ │ └── user-lock.hh │ │ ├── meson.build │ │ ├── pathlocks.cc │ │ └── user-lock.cc │ ├── windows │ │ ├── meson.build │ │ └── pathlocks.cc │ ├── worker-protocol-connection.cc │ └── worker-protocol.cc ├── libutil-c │ ├── .version │ ├── meson.build │ ├── meson.options │ ├── nix-meson-build-support │ ├── nix_api_util.cc │ ├── nix_api_util.h │ ├── nix_api_util_internal.h │ └── package.nix ├── libutil-test-support │ ├── .version │ ├── hash.cc │ ├── include │ │ └── nix │ │ │ └── util │ │ │ └── tests │ │ │ ├── characterization.hh │ │ │ ├── gtest-with-params.hh │ │ │ ├── hash.hh │ │ │ ├── meson.build │ │ │ ├── nix_api_util.hh │ │ │ └── string_callback.hh │ ├── meson.build │ ├── nix-meson-build-support │ ├── package.nix │ └── string_callback.cc ├── libutil-tests │ ├── .version │ ├── args.cc │ ├── canon-path.cc │ ├── checked-arithmetic.cc │ ├── chunked-vector.cc │ ├── closure.cc │ ├── compression.cc │ ├── config.cc │ ├── data │ │ └── git │ │ │ ├── check-data.sh │ │ │ ├── hello-world-blob.bin │ │ │ ├── hello-world.bin │ │ │ ├── tree.bin │ │ │ └── tree.txt │ ├── executable-path.cc │ ├── file-content-address.cc │ ├── file-system.cc │ ├── git.cc │ ├── hash.cc │ ├── hilite.cc │ ├── json-utils.cc │ ├── logging.cc │ ├── lru-cache.cc │ ├── meson.build │ ├── monitorfdhup.cc │ ├── nix-meson-build-support │ ├── nix_api_util.cc │ ├── package.nix │ ├── pool.cc │ ├── position.cc │ ├── processes.cc │ ├── references.cc │ ├── spawn.cc │ ├── strings.cc │ ├── suggestions.cc │ ├── terminal.cc │ ├── url.cc │ ├── util.cc │ └── xml-writer.cc ├── libutil │ ├── .version │ ├── archive.cc │ ├── args.cc │ ├── canon-path.cc │ ├── compression.cc │ ├── compute-levels.cc │ ├── config-global.cc │ ├── configuration.cc │ ├── current-process.cc │ ├── english.cc │ ├── environment-variables.cc │ ├── error.cc │ ├── executable-path.cc │ ├── exit.cc │ ├── experimental-features.cc │ ├── file-content-address.cc │ ├── file-descriptor.cc │ ├── file-system.cc │ ├── freebsd │ │ ├── freebsd-jail.cc │ │ ├── include │ │ │ └── nix │ │ │ │ └── util │ │ │ │ ├── freebsd-jail.hh │ │ │ │ └── meson.build │ │ └── meson.build │ ├── fs-sink.cc │ ├── git.cc │ ├── hash.cc │ ├── hilite.cc │ ├── include │ │ └── nix │ │ │ └── util │ │ │ ├── abstract-setting-to-json.hh │ │ │ ├── ansicolor.hh │ │ │ ├── archive.hh │ │ │ ├── args.hh │ │ │ ├── args │ │ │ └── root.hh │ │ │ ├── callback.hh │ │ │ ├── canon-path.hh │ │ │ ├── checked-arithmetic.hh │ │ │ ├── chunked-vector.hh │ │ │ ├── closure.hh │ │ │ ├── comparator.hh │ │ │ ├── compression.hh │ │ │ ├── compute-levels.hh │ │ │ ├── config-global.hh │ │ │ ├── config-impl.hh │ │ │ ├── configuration.hh │ │ │ ├── current-process.hh │ │ │ ├── english.hh │ │ │ ├── environment-variables.hh │ │ │ ├── error.hh │ │ │ ├── exec.hh │ │ │ ├── executable-path.hh │ │ │ ├── exit.hh │ │ │ ├── experimental-features.hh │ │ │ ├── file-content-address.hh │ │ │ ├── file-descriptor.hh │ │ │ ├── file-path-impl.hh │ │ │ ├── file-path.hh │ │ │ ├── file-system.hh │ │ │ ├── finally.hh │ │ │ ├── fmt.hh │ │ │ ├── fs-sink.hh │ │ │ ├── git.hh │ │ │ ├── hash.hh │ │ │ ├── hilite.hh │ │ │ ├── json-impls.hh │ │ │ ├── json-utils.hh │ │ │ ├── logging.hh │ │ │ ├── lru-cache.hh │ │ │ ├── memory-source-accessor.hh │ │ │ ├── meson.build │ │ │ ├── muxable-pipe.hh │ │ │ ├── os-string.hh │ │ │ ├── pool.hh │ │ │ ├── pos-idx.hh │ │ │ ├── pos-table.hh │ │ │ ├── position.hh │ │ │ ├── posix-source-accessor.hh │ │ │ ├── processes.hh │ │ │ ├── ref.hh │ │ │ ├── references.hh │ │ │ ├── regex-combinators.hh │ │ │ ├── repair-flag.hh │ │ │ ├── serialise.hh │ │ │ ├── signals.hh │ │ │ ├── signature │ │ │ ├── local-keys.hh │ │ │ └── signer.hh │ │ │ ├── source-accessor.hh │ │ │ ├── source-path.hh │ │ │ ├── split.hh │ │ │ ├── std-hash.hh │ │ │ ├── strings-inline.hh │ │ │ ├── strings.hh │ │ │ ├── suggestions.hh │ │ │ ├── sync.hh │ │ │ ├── tarfile.hh │ │ │ ├── terminal.hh │ │ │ ├── thread-pool.hh │ │ │ ├── topo-sort.hh │ │ │ ├── types.hh │ │ │ ├── unix-domain-socket.hh │ │ │ ├── url-parts.hh │ │ │ ├── url.hh │ │ │ ├── users.hh │ │ │ ├── util.hh │ │ │ ├── variant-wrapper.hh │ │ │ └── xml-writer.hh │ ├── json-utils.cc │ ├── linux │ │ ├── cgroup.cc │ │ ├── include │ │ │ └── nix │ │ │ │ └── util │ │ │ │ ├── cgroup.hh │ │ │ │ ├── linux-namespaces.hh │ │ │ │ └── meson.build │ │ ├── linux-namespaces.cc │ │ └── meson.build │ ├── logging.cc │ ├── memory-source-accessor.cc │ ├── meson.build │ ├── meson.options │ ├── mounted-source-accessor.cc │ ├── nix-meson-build-support │ ├── package.nix │ ├── pos-table.cc │ ├── position.cc │ ├── posix-source-accessor.cc │ ├── references.cc │ ├── serialise.cc │ ├── signature │ │ ├── local-keys.cc │ │ └── signer.cc │ ├── source-accessor.cc │ ├── source-path.cc │ ├── strings.cc │ ├── subdir-source-accessor.cc │ ├── suggestions.cc │ ├── tarfile.cc │ ├── tee-logger.cc │ ├── terminal.cc │ ├── thread-pool.cc │ ├── union-source-accessor.cc │ ├── unix-domain-socket.cc │ ├── unix │ │ ├── environment-variables.cc │ │ ├── file-descriptor.cc │ │ ├── file-path.cc │ │ ├── file-system.cc │ │ ├── include │ │ │ └── nix │ │ │ │ └── util │ │ │ │ ├── meson.build │ │ │ │ ├── monitor-fd.hh │ │ │ │ └── signals-impl.hh │ │ ├── meson.build │ │ ├── muxable-pipe.cc │ │ ├── os-string.cc │ │ ├── processes.cc │ │ ├── signals.cc │ │ └── users.cc │ ├── url.cc │ ├── users.cc │ ├── util.cc │ ├── widecharwidth │ │ ├── LICENSE │ │ └── widechar_width.h │ ├── windows │ │ ├── environment-variables.cc │ │ ├── file-descriptor.cc │ │ ├── file-path.cc │ │ ├── file-system.cc │ │ ├── include │ │ │ └── nix │ │ │ │ └── util │ │ │ │ ├── meson.build │ │ │ │ ├── signals-impl.hh │ │ │ │ ├── windows-async-pipe.hh │ │ │ │ └── windows-error.hh │ │ ├── meson.build │ │ ├── muxable-pipe.cc │ │ ├── os-string.cc │ │ ├── processes.cc │ │ ├── users.cc │ │ ├── windows-async-pipe.cc │ │ └── windows-error.cc │ └── xml-writer.cc ├── nix-build │ └── nix-build.cc ├── nix-channel │ ├── nix-channel.cc │ └── unpack-channel.nix ├── nix-collect-garbage │ └── nix-collect-garbage.cc ├── nix-copy-closure │ └── nix-copy-closure.cc ├── nix-env │ ├── buildenv.nix │ ├── nix-env.cc │ ├── user-env.cc │ └── user-env.hh ├── nix-functional-tests ├── nix-instantiate │ └── nix-instantiate.cc ├── nix-manual ├── nix-store │ ├── dotgraph.cc │ ├── dotgraph.hh │ ├── graphml.cc │ ├── graphml.hh │ └── nix-store.cc ├── nix │ ├── .version │ ├── add-to-store.cc │ ├── add.md │ ├── app.cc │ ├── build-remote │ ├── build.cc │ ├── build.md │ ├── bundle.cc │ ├── bundle.md │ ├── cat.cc │ ├── config-check.cc │ ├── config.cc │ ├── copy.cc │ ├── copy.md │ ├── crash-handler.cc │ ├── crash-handler.hh │ ├── derivation-add.cc │ ├── derivation-add.md │ ├── derivation-show.cc │ ├── derivation-show.md │ ├── derivation.cc │ ├── develop.cc │ ├── develop.md │ ├── diff-closures.cc │ ├── diff-closures.md │ ├── doc │ ├── dump-path.cc │ ├── edit.cc │ ├── edit.md │ ├── env.cc │ ├── eval.cc │ ├── eval.md │ ├── flake-archive.md │ ├── flake-check.md │ ├── flake-clone.md │ ├── flake-init.md │ ├── flake-lock.md │ ├── flake-metadata.md │ ├── flake-new.md │ ├── flake-prefetch.md │ ├── flake-show.md │ ├── flake-update.md │ ├── flake.cc │ ├── flake.md │ ├── formatter-build.md │ ├── formatter-run.md │ ├── formatter.cc │ ├── get-env.sh │ ├── hash-convert.md │ ├── hash.cc │ ├── help-stores.md │ ├── help.md │ ├── key-convert-secret-to-public.md │ ├── key-generate-secret.md │ ├── log.cc │ ├── log.md │ ├── ls.cc │ ├── main.cc │ ├── make-content-addressed.cc │ ├── make-content-addressed.md │ ├── man-pages.cc │ ├── man-pages.hh │ ├── meson.build │ ├── meson.options │ ├── misc │ ├── nar-cat.md │ ├── nar-dump-path.md │ ├── nar-ls.md │ ├── nar.cc │ ├── nar.md │ ├── nix-build │ ├── nix-channel │ ├── nix-collect-garbage │ ├── nix-copy-closure │ ├── nix-env │ ├── nix-instantiate │ ├── nix-meson-build-support │ ├── nix-store │ ├── nix.md │ ├── optimise-store.cc │ ├── optimise-store.md │ ├── package.nix │ ├── path-from-hash-part.cc │ ├── path-from-hash-part.md │ ├── path-info.cc │ ├── path-info.md │ ├── prefetch.cc │ ├── print-dev-env.md │ ├── profile-add.md │ ├── profile-diff-closures.md │ ├── profile-history.md │ ├── profile-list.md │ ├── profile-remove.md │ ├── profile-rollback.md │ ├── profile-upgrade.md │ ├── profile-wipe-history.md │ ├── profile.cc │ ├── profile.md │ ├── profiles.md │ ├── realisation.cc │ ├── realisation │ │ └── info.md │ ├── registry-add.md │ ├── registry-list.md │ ├── registry-pin.md │ ├── registry-remove.md │ ├── registry.cc │ ├── registry.md │ ├── repl.cc │ ├── repl.md │ ├── run.cc │ ├── run.hh │ ├── run.md │ ├── scripts │ ├── search.cc │ ├── search.md │ ├── self-exe.cc │ ├── self-exe.hh │ ├── shell.md │ ├── sigs.cc │ ├── store-cat.md │ ├── store-copy-log.cc │ ├── store-copy-log.md │ ├── store-delete.cc │ ├── store-delete.md │ ├── store-dump-path.md │ ├── store-gc.cc │ ├── store-gc.md │ ├── store-info.cc │ ├── store-info.md │ ├── store-ls.md │ ├── store-prefetch-file.md │ ├── store-repair.cc │ ├── store-repair.md │ ├── store.cc │ ├── unix │ │ ├── daemon.cc │ │ └── daemon.md │ ├── upgrade-nix.cc │ ├── upgrade-nix.md │ ├── verify.cc │ ├── verify.md │ ├── why-depends.cc │ └── why-depends.md └── perl │ ├── .version │ ├── .yath.rc.in │ ├── MANIFEST │ ├── lib │ └── Nix │ │ ├── Config.pm.in │ │ ├── CopyClosure.pm │ │ ├── Manifest.pm │ │ ├── SSH.pm │ │ ├── Store.pm │ │ ├── Store.xs │ │ ├── Utils.pm │ │ └── meson.build │ ├── meson.build │ ├── meson.options │ ├── package.nix │ └── t │ ├── init.t │ └── meson.build └── tests ├── functional ├── .version ├── add.sh ├── bash-profile.sh ├── big-derivation-attr.nix ├── binary-cache-build-remote.sh ├── binary-cache.sh ├── brotli.sh ├── build-delete.sh ├── build-dry.sh ├── build-hook-ca-fixed.nix ├── build-hook-ca-floating.nix ├── build-hook.nix ├── build-remote-content-addressed-fixed.sh ├── build-remote-content-addressed-floating.sh ├── build-remote-input-addressed.sh ├── build-remote-trustless-after.sh ├── build-remote-trustless-should-fail-0.sh ├── build-remote-trustless-should-pass-0.sh ├── build-remote-trustless-should-pass-1.sh ├── build-remote-trustless-should-pass-2.sh ├── build-remote-trustless-should-pass-3.sh ├── build-remote-trustless.sh ├── build-remote-with-mounted-ssh-ng.sh ├── build-remote.sh ├── build.sh ├── ca-shell.nix ├── ca │ ├── build-cache.sh │ ├── build-dry.sh │ ├── build-with-garbage-path.sh │ ├── build.sh │ ├── common.sh │ ├── concurrent-builds.sh │ ├── config.nix │ ├── config.nix.in │ ├── content-addressed.nix │ ├── derivation-advanced-attributes.sh │ ├── derivation-json.sh │ ├── duplicate-realisation-in-closure.sh │ ├── eval-store.sh │ ├── flake.nix │ ├── gc.sh │ ├── import-from-derivation.sh │ ├── meson.build │ ├── new-build-cmd.sh │ ├── nix-copy.sh │ ├── nix-run.sh │ ├── nix-shell.sh │ ├── nondeterministic.nix │ ├── post-hook.sh │ ├── racy.nix │ ├── recursive.sh │ ├── repl.sh │ ├── selfref-gc.sh │ ├── signatures.sh │ ├── substitute.sh │ └── why-depends.sh ├── case-collision.nar ├── case.nar ├── characterisation-test-infra.sh ├── characterisation │ ├── empty │ └── framework.sh ├── check-refs.nix ├── check-refs.sh ├── check-reqs.nix ├── check-reqs.sh ├── check.nix ├── check.sh ├── chroot-store.sh ├── common.sh ├── common │ ├── functions.sh │ ├── init.sh │ ├── meson.build │ ├── paths.sh │ ├── subst-vars.sh.in │ ├── test-root.sh │ └── vars.sh ├── completions.sh ├── compression-levels.sh ├── compute-levels.sh ├── config.nix ├── config.nix.in ├── config.sh ├── config │ ├── extra-config.conf │ ├── nix-with-bang-include.conf │ ├── nix-with-include.conf │ └── nix-with-substituters.conf ├── db-migration.sh ├── debugger.sh ├── dependencies.builder0.sh ├── dependencies.nix ├── dependencies.sh ├── derivation-advanced-attributes.sh ├── derivation-json.sh ├── derivation │ ├── advanced-attributes-defaults.nix │ ├── advanced-attributes-structured-attrs-defaults.nix │ ├── advanced-attributes-structured-attrs.nix │ ├── advanced-attributes.nix │ ├── ca │ │ ├── advanced-attributes-defaults.drv │ │ ├── advanced-attributes-structured-attrs-defaults.drv │ │ ├── advanced-attributes-structured-attrs.drv │ │ └── advanced-attributes.drv │ └── ia │ │ ├── advanced-attributes-defaults.drv │ │ ├── advanced-attributes-structured-attrs-defaults.drv │ │ ├── advanced-attributes-structured-attrs.drv │ │ └── advanced-attributes.drv ├── dot.nar ├── dotdot.nar ├── dummy ├── dump-db.sh ├── duplicate.nar ├── dyn-drv │ ├── build-built-drv.sh │ ├── common.sh │ ├── config.nix │ ├── config.nix.in │ ├── dep-built-drv-2.sh │ ├── dep-built-drv.sh │ ├── eval-outputOf.sh │ ├── failing-outer.sh │ ├── meson.build │ ├── non-trivial.nix │ ├── old-daemon-error-hack.nix │ ├── old-daemon-error-hack.sh │ ├── recursive-mod-json.nix │ ├── recursive-mod-json.sh │ ├── text-hashed-output.nix │ └── text-hashed-output.sh ├── empty.nar ├── eval-store.sh ├── eval.nix ├── eval.sh ├── executable-after-contents.nar ├── experimental-features.sh ├── export-graph.nix ├── export-graph.sh ├── export.sh ├── extra-sandbox-profile.nix ├── extra-sandbox-profile.sh ├── failing.nix ├── fetchClosure.sh ├── fetchGit.sh ├── fetchGitRefs.sh ├── fetchGitShallow.sh ├── fetchGitSubmodules.sh ├── fetchGitVerification.sh ├── fetchMercurial.sh ├── fetchPath.sh ├── fetchTree-file.sh ├── fetchurl.sh ├── filter-source.nix ├── filter-source.sh ├── fixed.builder1.sh ├── fixed.builder2.sh ├── fixed.nix ├── fixed.sh ├── flakes │ ├── absolute-attr-paths.sh │ ├── absolute-paths.sh │ ├── build-paths.sh │ ├── bundle.sh │ ├── check.sh │ ├── circular.sh │ ├── commit-lock-file-summary.sh │ ├── common.sh │ ├── config.sh │ ├── debugger.sh │ ├── develop.sh │ ├── dubious-query.sh │ ├── edit.sh │ ├── eval-cache.sh │ ├── flake-in-submodule.sh │ ├── flakes.sh │ ├── follow-paths.sh │ ├── init.sh │ ├── inputs.sh │ ├── mercurial.sh │ ├── meson.build │ ├── non-flake-inputs.sh │ ├── old-lockfiles.sh │ ├── prefetch.sh │ ├── relative-paths-lockfile.sh │ ├── relative-paths.sh │ ├── run.sh │ ├── search-root.sh │ ├── shebang.sh │ ├── show.sh │ ├── source-paths.sh │ ├── symlink-paths.sh │ ├── trace-ifd.sh │ ├── tree.zip │ └── unlocked-override.sh ├── flamegraph-profiler.sh ├── fod-failing.nix ├── formatter.sh ├── formatter.simple.sh ├── function-trace.sh ├── gc-auto.sh ├── gc-concurrent.builder.sh ├── gc-concurrent.nix ├── gc-concurrent.sh ├── gc-concurrent2.builder.sh ├── gc-non-blocking.sh ├── gc-runtime.nix ├── gc-runtime.sh ├── gc.sh ├── git-hashing │ ├── common.sh │ ├── fixed.sh │ ├── meson.build │ └── simple.sh ├── hash-check.nix ├── hash-convert.sh ├── hash-path.sh ├── help.sh ├── hermetic.nix ├── ifd.nix ├── import-from-derivation.nix ├── import-from-derivation.sh ├── impure-derivations.nix ├── impure-derivations.sh ├── impure-env.nix ├── impure-env.sh ├── impure-eval.sh ├── install-darwin.sh ├── json.sh ├── lang-gc.sh ├── lang-gc │ └── issue-11141-gc-coroutine-test.nix ├── lang.sh ├── lang │ ├── binary-data │ ├── data │ ├── dir1 │ │ └── a.nix │ ├── dir2 │ │ ├── a.nix │ │ └── b.nix │ ├── dir3 │ │ ├── a.nix │ │ ├── b.nix │ │ └── c.nix │ ├── dir4 │ │ ├── a.nix │ │ └── c.nix │ ├── eval-fail-abort.err.exp │ ├── eval-fail-abort.nix │ ├── eval-fail-addDrvOutputDependencies-empty-context.err.exp │ ├── eval-fail-addDrvOutputDependencies-empty-context.nix │ ├── eval-fail-addDrvOutputDependencies-multi-elem-context.err.exp │ ├── eval-fail-addDrvOutputDependencies-multi-elem-context.nix │ ├── eval-fail-addDrvOutputDependencies-wrong-element-kind.err.exp │ ├── eval-fail-addDrvOutputDependencies-wrong-element-kind.nix │ ├── eval-fail-addErrorContext-example.err.exp │ ├── eval-fail-addErrorContext-example.flags │ ├── eval-fail-addErrorContext-example.nix │ ├── eval-fail-assert-equal-attrs-names-2.err.exp │ ├── eval-fail-assert-equal-attrs-names-2.nix │ ├── eval-fail-assert-equal-attrs-names.err.exp │ ├── eval-fail-assert-equal-attrs-names.nix │ ├── eval-fail-assert-equal-derivations-extra.err.exp │ ├── eval-fail-assert-equal-derivations-extra.nix │ ├── eval-fail-assert-equal-derivations.err.exp │ ├── eval-fail-assert-equal-derivations.nix │ ├── eval-fail-assert-equal-floats.err.exp │ ├── eval-fail-assert-equal-floats.nix │ ├── eval-fail-assert-equal-function-direct.err.exp │ ├── eval-fail-assert-equal-function-direct.nix │ ├── eval-fail-assert-equal-int-float.err.exp │ ├── eval-fail-assert-equal-int-float.nix │ ├── eval-fail-assert-equal-ints.err.exp │ ├── eval-fail-assert-equal-ints.nix │ ├── eval-fail-assert-equal-list-length.err.exp │ ├── eval-fail-assert-equal-list-length.nix │ ├── eval-fail-assert-equal-paths.err.exp │ ├── eval-fail-assert-equal-paths.nix │ ├── eval-fail-assert-equal-type-nested.err.exp │ ├── eval-fail-assert-equal-type-nested.nix │ ├── eval-fail-assert-equal-type.err.exp │ ├── eval-fail-assert-equal-type.nix │ ├── eval-fail-assert-nested-bool.err.exp │ ├── eval-fail-assert-nested-bool.nix │ ├── eval-fail-assert.err.exp │ ├── eval-fail-assert.nix │ ├── eval-fail-attr-name-type.err.exp │ ├── eval-fail-attr-name-type.nix │ ├── eval-fail-attrset-merge-drops-later-rec.err.exp │ ├── eval-fail-attrset-merge-drops-later-rec.nix │ ├── eval-fail-bad-string-interpolation-1.err.exp │ ├── eval-fail-bad-string-interpolation-1.nix │ ├── eval-fail-bad-string-interpolation-2.err.exp │ ├── eval-fail-bad-string-interpolation-2.nix │ ├── eval-fail-bad-string-interpolation-3.err.exp │ ├── eval-fail-bad-string-interpolation-3.nix │ ├── eval-fail-bad-string-interpolation-4.err.exp │ ├── eval-fail-bad-string-interpolation-4.nix │ ├── eval-fail-blackhole.err.exp │ ├── eval-fail-blackhole.nix │ ├── eval-fail-call-primop.err.exp │ ├── eval-fail-call-primop.nix │ ├── eval-fail-deepseq.err.exp │ ├── eval-fail-deepseq.nix │ ├── eval-fail-derivation-name.err.exp │ ├── eval-fail-derivation-name.nix │ ├── eval-fail-derivation-name.postprocess │ ├── eval-fail-dup-dynamic-attrs.err.exp │ ├── eval-fail-dup-dynamic-attrs.nix │ ├── eval-fail-duplicate-traces.err.exp │ ├── eval-fail-duplicate-traces.nix │ ├── eval-fail-eol-1.err.exp │ ├── eval-fail-eol-1.nix │ ├── eval-fail-eol-2.err.exp │ ├── eval-fail-eol-2.nix │ ├── eval-fail-eol-3.err.exp │ ├── eval-fail-eol-3.nix │ ├── eval-fail-fetchTree-negative.err.exp │ ├── eval-fail-fetchTree-negative.nix │ ├── eval-fail-fetchurl-baseName-attrs-name.err.exp │ ├── eval-fail-fetchurl-baseName-attrs-name.nix │ ├── eval-fail-fetchurl-baseName-attrs.err.exp │ ├── eval-fail-fetchurl-baseName-attrs.nix │ ├── eval-fail-fetchurl-baseName.err.exp │ ├── eval-fail-fetchurl-baseName.nix │ ├── eval-fail-flake-ref-to-string-negative-integer.err.exp │ ├── eval-fail-flake-ref-to-string-negative-integer.nix │ ├── eval-fail-foldlStrict-strict-op-application.err.exp │ ├── eval-fail-foldlStrict-strict-op-application.nix │ ├── eval-fail-fromJSON-keyWithNullByte.err.exp │ ├── eval-fail-fromJSON-keyWithNullByte.nix │ ├── eval-fail-fromJSON-overflowing.err.exp │ ├── eval-fail-fromJSON-overflowing.nix │ ├── eval-fail-fromJSON-valueWithNullByte.err.exp │ ├── eval-fail-fromJSON-valueWithNullByte.nix │ ├── eval-fail-fromTOML-keyWithNullByte.err.exp │ ├── eval-fail-fromTOML-keyWithNullByte.nix │ ├── eval-fail-fromTOML-timestamps.err.exp │ ├── eval-fail-fromTOML-timestamps.nix │ ├── eval-fail-fromTOML-valueWithNullByte.err.exp │ ├── eval-fail-fromTOML-valueWithNullByte.nix │ ├── eval-fail-hashfile-missing.err.exp │ ├── eval-fail-hashfile-missing.nix │ ├── eval-fail-infinite-recursion-lambda.err.exp │ ├── eval-fail-infinite-recursion-lambda.flags │ ├── eval-fail-infinite-recursion-lambda.nix │ ├── eval-fail-list.err.exp │ ├── eval-fail-list.nix │ ├── eval-fail-missing-arg.err.exp │ ├── eval-fail-missing-arg.nix │ ├── eval-fail-mutual-recursion.err.exp │ ├── eval-fail-mutual-recursion.nix │ ├── eval-fail-nested-list-items.err.exp │ ├── eval-fail-nested-list-items.nix │ ├── eval-fail-nonexist-path.err.exp │ ├── eval-fail-nonexist-path.nix │ ├── eval-fail-not-throws.err.exp │ ├── eval-fail-not-throws.nix │ ├── eval-fail-overflowing-add.err.exp │ ├── eval-fail-overflowing-add.nix │ ├── eval-fail-overflowing-div.err.exp │ ├── eval-fail-overflowing-div.nix │ ├── eval-fail-overflowing-mul.err.exp │ ├── eval-fail-overflowing-mul.nix │ ├── eval-fail-overflowing-sub.err.exp │ ├── eval-fail-overflowing-sub.nix │ ├── eval-fail-path-slash.err.exp │ ├── eval-fail-path-slash.nix │ ├── eval-fail-pipe-operators.err.exp │ ├── eval-fail-pipe-operators.nix │ ├── eval-fail-recursion.err.exp │ ├── eval-fail-recursion.nix │ ├── eval-fail-remove.err.exp │ ├── eval-fail-remove.nix │ ├── eval-fail-scope-5.err.exp │ ├── eval-fail-scope-5.nix │ ├── eval-fail-seq.err.exp │ ├── eval-fail-seq.nix │ ├── eval-fail-set-override.err.exp │ ├── eval-fail-set-override.nix │ ├── eval-fail-set.err.exp │ ├── eval-fail-set.nix │ ├── eval-fail-string-nul-1.err.exp │ ├── eval-fail-string-nul-1.nix │ ├── eval-fail-string-nul-2.err.exp │ ├── eval-fail-string-nul-2.nix │ ├── eval-fail-substring.err.exp │ ├── eval-fail-substring.nix │ ├── eval-fail-to-path.err.exp │ ├── eval-fail-to-path.nix │ ├── eval-fail-toJSON-non-utf-8.err.exp │ ├── eval-fail-toJSON-non-utf-8.nix │ ├── eval-fail-toJSON.err.exp │ ├── eval-fail-toJSON.nix │ ├── eval-fail-undeclared-arg.err.exp │ ├── eval-fail-undeclared-arg.nix │ ├── eval-fail-using-set-as-attr-name.err.exp │ ├── eval-fail-using-set-as-attr-name.nix │ ├── eval-okay-any-all.exp │ ├── eval-okay-any-all.nix │ ├── eval-okay-arithmetic.exp │ ├── eval-okay-arithmetic.nix │ ├── eval-okay-attrnames.exp │ ├── eval-okay-attrnames.nix │ ├── eval-okay-attrs.exp │ ├── eval-okay-attrs.nix │ ├── eval-okay-attrs2.exp │ ├── eval-okay-attrs2.nix │ ├── eval-okay-attrs3.exp │ ├── eval-okay-attrs3.nix │ ├── eval-okay-attrs4.exp │ ├── eval-okay-attrs4.nix │ ├── eval-okay-attrs5.exp │ ├── eval-okay-attrs5.nix │ ├── eval-okay-attrs6.exp │ ├── eval-okay-attrs6.nix │ ├── eval-okay-autoargs.exp │ ├── eval-okay-autoargs.flags │ ├── eval-okay-autoargs.nix │ ├── eval-okay-backslash-newline-1.exp │ ├── eval-okay-backslash-newline-1.nix │ ├── eval-okay-backslash-newline-2.exp │ ├── eval-okay-backslash-newline-2.nix │ ├── eval-okay-baseNameOf.exp │ ├── eval-okay-baseNameOf.nix │ ├── eval-okay-builtins-add.exp │ ├── eval-okay-builtins-add.nix │ ├── eval-okay-builtins.exp │ ├── eval-okay-builtins.nix │ ├── eval-okay-callable-attrs.exp │ ├── eval-okay-callable-attrs.nix │ ├── eval-okay-catattrs.exp │ ├── eval-okay-catattrs.nix │ ├── eval-okay-closure.exp │ ├── eval-okay-closure.exp.xml │ ├── eval-okay-closure.nix │ ├── eval-okay-comments.exp │ ├── eval-okay-comments.nix │ ├── eval-okay-concat.exp │ ├── eval-okay-concat.nix │ ├── eval-okay-concatmap.exp │ ├── eval-okay-concatmap.nix │ ├── eval-okay-concatstringssep.exp │ ├── eval-okay-concatstringssep.nix │ ├── eval-okay-context-introspection.exp │ ├── eval-okay-context-introspection.nix │ ├── eval-okay-context.exp │ ├── eval-okay-context.nix │ ├── eval-okay-convertHash.err.exp │ ├── eval-okay-convertHash.exp │ ├── eval-okay-convertHash.nix │ ├── eval-okay-curpos.exp │ ├── eval-okay-curpos.nix │ ├── eval-okay-deepseq.exp │ ├── eval-okay-deepseq.nix │ ├── eval-okay-delayed-with-inherit.exp │ ├── eval-okay-delayed-with-inherit.nix │ ├── eval-okay-delayed-with.exp │ ├── eval-okay-delayed-with.nix │ ├── eval-okay-deprecate-cursed-or.err.exp │ ├── eval-okay-deprecate-cursed-or.exp │ ├── eval-okay-deprecate-cursed-or.nix │ ├── eval-okay-derivation-legacy.err.exp │ ├── eval-okay-derivation-legacy.exp │ ├── eval-okay-derivation-legacy.nix │ ├── eval-okay-dynamic-attrs-2.exp │ ├── eval-okay-dynamic-attrs-2.nix │ ├── eval-okay-dynamic-attrs-bare.exp │ ├── eval-okay-dynamic-attrs-bare.nix │ ├── eval-okay-dynamic-attrs.exp │ ├── eval-okay-dynamic-attrs.nix │ ├── eval-okay-elem.exp │ ├── eval-okay-elem.nix │ ├── eval-okay-empty-args.exp │ ├── eval-okay-empty-args.nix │ ├── eval-okay-eq-derivations.exp │ ├── eval-okay-eq-derivations.nix │ ├── eval-okay-eq.exp │ ├── eval-okay-eq.nix │ ├── eval-okay-filter.exp │ ├── eval-okay-filter.nix │ ├── eval-okay-flake-ref-to-string.exp │ ├── eval-okay-flake-ref-to-string.nix │ ├── eval-okay-flatten.exp │ ├── eval-okay-flatten.nix │ ├── eval-okay-float.exp │ ├── eval-okay-float.nix │ ├── eval-okay-floor-ceil.exp │ ├── eval-okay-floor-ceil.nix │ ├── eval-okay-foldlStrict-lazy-elements.exp │ ├── eval-okay-foldlStrict-lazy-elements.nix │ ├── eval-okay-foldlStrict-lazy-initial-accumulator.exp │ ├── eval-okay-foldlStrict-lazy-initial-accumulator.nix │ ├── eval-okay-foldlStrict.exp │ ├── eval-okay-foldlStrict.nix │ ├── eval-okay-fromTOML-timestamps.exp │ ├── eval-okay-fromTOML-timestamps.flags │ ├── eval-okay-fromTOML-timestamps.nix │ ├── eval-okay-fromTOML.exp │ ├── eval-okay-fromTOML.nix │ ├── eval-okay-fromjson-escapes.exp │ ├── eval-okay-fromjson-escapes.nix │ ├── eval-okay-fromjson.exp │ ├── eval-okay-fromjson.nix │ ├── eval-okay-functionargs.exp │ ├── eval-okay-functionargs.exp.xml │ ├── eval-okay-functionargs.nix │ ├── eval-okay-getattrpos-functionargs.exp │ ├── eval-okay-getattrpos-functionargs.nix │ ├── eval-okay-getattrpos-undefined.exp │ ├── eval-okay-getattrpos-undefined.nix │ ├── eval-okay-getattrpos.exp │ ├── eval-okay-getattrpos.nix │ ├── eval-okay-getenv.exp │ ├── eval-okay-getenv.nix │ ├── eval-okay-groupBy.exp │ ├── eval-okay-groupBy.nix │ ├── eval-okay-hash.exp │ ├── eval-okay-hashfile.exp │ ├── eval-okay-hashfile.nix │ ├── eval-okay-hashstring.exp │ ├── eval-okay-hashstring.nix │ ├── eval-okay-if.exp │ ├── eval-okay-if.nix │ ├── eval-okay-import.exp │ ├── eval-okay-import.nix │ ├── eval-okay-ind-string.exp │ ├── eval-okay-ind-string.nix │ ├── eval-okay-inherit-attr-pos.exp │ ├── eval-okay-inherit-attr-pos.nix │ ├── eval-okay-inherit-from.err.exp │ ├── eval-okay-inherit-from.exp │ ├── eval-okay-inherit-from.nix │ ├── eval-okay-intersectAttrs.exp │ ├── eval-okay-intersectAttrs.nix │ ├── eval-okay-let.exp │ ├── eval-okay-let.nix │ ├── eval-okay-list.exp │ ├── eval-okay-list.nix │ ├── eval-okay-listtoattrs.exp │ ├── eval-okay-listtoattrs.nix │ ├── eval-okay-logic.exp │ ├── eval-okay-logic.nix │ ├── eval-okay-map.exp │ ├── eval-okay-map.nix │ ├── eval-okay-mapattrs.exp │ ├── eval-okay-mapattrs.nix │ ├── eval-okay-merge-dynamic-attrs.exp │ ├── eval-okay-merge-dynamic-attrs.nix │ ├── eval-okay-nested-with.exp │ ├── eval-okay-nested-with.nix │ ├── eval-okay-new-let.exp │ ├── eval-okay-new-let.nix │ ├── eval-okay-null-dynamic-attrs.exp │ ├── eval-okay-null-dynamic-attrs.nix │ ├── eval-okay-overrides.exp │ ├── eval-okay-overrides.nix │ ├── eval-okay-parse-flake-ref.exp │ ├── eval-okay-parse-flake-ref.nix │ ├── eval-okay-partition.exp │ ├── eval-okay-partition.nix │ ├── eval-okay-path-string-interpolation.exp │ ├── eval-okay-path-string-interpolation.nix │ ├── eval-okay-path.exp │ ├── eval-okay-path.nix │ ├── eval-okay-pathexists.exp │ ├── eval-okay-pathexists.nix │ ├── eval-okay-patterns.exp │ ├── eval-okay-patterns.nix │ ├── eval-okay-print.err.exp │ ├── eval-okay-print.exp │ ├── eval-okay-print.nix │ ├── eval-okay-readDir.exp │ ├── eval-okay-readDir.nix │ ├── eval-okay-readFileType.exp │ ├── eval-okay-readFileType.nix │ ├── eval-okay-readfile.exp │ ├── eval-okay-readfile.nix │ ├── eval-okay-redefine-builtin.exp │ ├── eval-okay-redefine-builtin.nix │ ├── eval-okay-regex-match.exp │ ├── eval-okay-regex-match.nix │ ├── eval-okay-regex-match2.exp │ ├── eval-okay-regex-match2.nix │ ├── eval-okay-regex-split.exp │ ├── eval-okay-regex-split.nix │ ├── eval-okay-regression-20220122.exp │ ├── eval-okay-regression-20220122.nix │ ├── eval-okay-regression-20220125.exp │ ├── eval-okay-regression-20220125.nix │ ├── eval-okay-regrettable-rec-attrset-merge.exp │ ├── eval-okay-regrettable-rec-attrset-merge.nix │ ├── eval-okay-remove.exp │ ├── eval-okay-remove.nix │ ├── eval-okay-repeated-empty-attrs.exp │ ├── eval-okay-repeated-empty-attrs.nix │ ├── eval-okay-repeated-empty-list.exp │ ├── eval-okay-repeated-empty-list.nix │ ├── eval-okay-replacestrings.exp │ ├── eval-okay-replacestrings.nix │ ├── eval-okay-scope-1.exp │ ├── eval-okay-scope-1.nix │ ├── eval-okay-scope-2.exp │ ├── eval-okay-scope-2.nix │ ├── eval-okay-scope-3.exp │ ├── eval-okay-scope-3.nix │ ├── eval-okay-scope-4.exp │ ├── eval-okay-scope-4.nix │ ├── eval-okay-scope-6.exp │ ├── eval-okay-scope-6.nix │ ├── eval-okay-scope-7.exp │ ├── eval-okay-scope-7.nix │ ├── eval-okay-search-path.exp │ ├── eval-okay-search-path.flags │ ├── eval-okay-search-path.nix │ ├── eval-okay-seq.exp │ ├── eval-okay-seq.nix │ ├── eval-okay-sort.exp │ ├── eval-okay-sort.nix │ ├── eval-okay-splitversion.exp │ ├── eval-okay-splitversion.nix │ ├── eval-okay-string.exp │ ├── eval-okay-string.nix │ ├── eval-okay-strings-as-attrs-names.exp │ ├── eval-okay-strings-as-attrs-names.nix │ ├── eval-okay-substring-context.exp │ ├── eval-okay-substring-context.nix │ ├── eval-okay-substring.exp │ ├── eval-okay-substring.nix │ ├── eval-okay-symlink-resolution.exp │ ├── eval-okay-symlink-resolution.nix │ ├── eval-okay-tail-call-1.exp-disabled │ ├── eval-okay-tail-call-1.nix │ ├── eval-okay-tojson.exp │ ├── eval-okay-tojson.nix │ ├── eval-okay-toxml.exp │ ├── eval-okay-toxml.nix │ ├── eval-okay-toxml2.exp │ ├── eval-okay-toxml2.nix │ ├── eval-okay-tryeval.exp │ ├── eval-okay-tryeval.nix │ ├── eval-okay-types.exp │ ├── eval-okay-types.nix │ ├── eval-okay-versions.exp │ ├── eval-okay-versions.nix │ ├── eval-okay-with.exp │ ├── eval-okay-with.nix │ ├── eval-okay-xml.exp.xml │ ├── eval-okay-xml.nix │ ├── eval-okay-zipAttrsWith.exp │ ├── eval-okay-zipAttrsWith.nix │ ├── imported.nix │ ├── imported2.nix │ ├── lib.nix │ ├── non-eval-fail-bad-drvPath.nix │ ├── parse-fail-dup-attrs-1.err.exp │ ├── parse-fail-dup-attrs-1.nix │ ├── parse-fail-dup-attrs-2.err.exp │ ├── parse-fail-dup-attrs-2.nix │ ├── parse-fail-dup-attrs-3.err.exp │ ├── parse-fail-dup-attrs-3.nix │ ├── parse-fail-dup-attrs-4.err.exp │ ├── parse-fail-dup-attrs-4.nix │ ├── parse-fail-dup-attrs-7.err.exp │ ├── parse-fail-dup-attrs-7.nix │ ├── parse-fail-dup-formals.err.exp │ ├── parse-fail-dup-formals.nix │ ├── parse-fail-eof-in-string.err.exp │ ├── parse-fail-eof-in-string.nix │ ├── parse-fail-eof-pos.err.exp │ ├── parse-fail-eof-pos.nix │ ├── parse-fail-mixed-nested-attrs1.err.exp │ ├── parse-fail-mixed-nested-attrs1.nix │ ├── parse-fail-mixed-nested-attrs2.err.exp │ ├── parse-fail-mixed-nested-attrs2.nix │ ├── parse-fail-patterns-1.err.exp │ ├── parse-fail-patterns-1.nix │ ├── parse-fail-regression-20060610.err.exp │ ├── parse-fail-regression-20060610.nix │ ├── parse-fail-undef-var-2.err.exp │ ├── parse-fail-undef-var-2.nix │ ├── parse-fail-undef-var.err.exp │ ├── parse-fail-undef-var.nix │ ├── parse-fail-utf8.err.exp │ ├── parse-fail-utf8.nix │ ├── parse-okay-1.exp │ ├── parse-okay-1.nix │ ├── parse-okay-crlf.exp │ ├── parse-okay-crlf.nix │ ├── parse-okay-dup-attrs-5.exp │ ├── parse-okay-dup-attrs-5.nix │ ├── parse-okay-dup-attrs-6.exp │ ├── parse-okay-dup-attrs-6.nix │ ├── parse-okay-ind-string.exp │ ├── parse-okay-ind-string.nix │ ├── parse-okay-inherits.exp │ ├── parse-okay-inherits.nix │ ├── parse-okay-mixed-nested-attrs-1.exp │ ├── parse-okay-mixed-nested-attrs-1.nix │ ├── parse-okay-mixed-nested-attrs-2.exp │ ├── parse-okay-mixed-nested-attrs-2.nix │ ├── parse-okay-mixed-nested-attrs-3.exp │ ├── parse-okay-mixed-nested-attrs-3.nix │ ├── parse-okay-regression-20041027.exp │ ├── parse-okay-regression-20041027.nix │ ├── parse-okay-regression-751.exp │ ├── parse-okay-regression-751.nix │ ├── parse-okay-subversion.exp │ ├── parse-okay-subversion.nix │ ├── parse-okay-url.exp │ ├── parse-okay-url.nix │ ├── readDir │ │ ├── bar │ │ ├── foo │ │ │ └── git-hates-directories │ │ ├── ldir │ │ └── linked │ └── symlink-resolution │ │ ├── broken │ │ ├── foo │ │ ├── lib │ │ │ └── default.nix │ │ └── overlays │ │ └── overlays │ │ └── overlay.nix ├── legacy-ssh-store.sh ├── linux-sandbox-cert-test.nix ├── linux-sandbox.sh ├── local-overlay-store │ ├── add-lower-inner.sh │ ├── add-lower.sh │ ├── bad-uris.sh │ ├── build-inner.sh │ ├── build.sh │ ├── check-post-init-inner.sh │ ├── check-post-init.sh │ ├── common.sh │ ├── delete-duplicate-inner.sh │ ├── delete-duplicate.sh │ ├── delete-refs-inner.sh │ ├── delete-refs.sh │ ├── gc-inner.sh │ ├── gc.sh │ ├── meson.build │ ├── optimise-inner.sh │ ├── optimise.sh │ ├── redundant-add-inner.sh │ ├── redundant-add.sh │ ├── remount.sh │ ├── stale-file-handle-inner.sh │ ├── stale-file-handle.sh │ ├── verify-inner.sh │ └── verify.sh ├── logging.sh ├── logging │ └── unusual-logging.nix ├── meson.build ├── misc.sh ├── multiple-outputs.nix ├── multiple-outputs.sh ├── name-after-node.nar ├── nar-access.nix ├── nar-access.sh ├── nars.sh ├── nested-sandboxing.sh ├── nested-sandboxing │ ├── command.sh │ └── runner.nix ├── nix-build-examples.nix ├── nix-build.sh ├── nix-channel.sh ├── nix-collect-garbage-d.sh ├── nix-copy-ssh-common.sh ├── nix-copy-ssh-ng.sh ├── nix-copy-ssh.sh ├── nix-daemon-untrusting.sh ├── nix-profile.sh ├── nix-shell.sh ├── nix_path.sh ├── nul-character.nar ├── optimise-store.sh ├── output-normalization.sh ├── package.nix ├── parallel.builder.sh ├── parallel.nix ├── parallel.sh ├── pass-as-file.sh ├── path-from-hash-part.sh ├── path-info.sh ├── path.nix ├── placeholders.sh ├── plugins.sh ├── plugins │ ├── meson.build │ └── plugintest.cc ├── post-hook.sh ├── pure-eval.nix ├── pure-eval.sh ├── push-to-store-old.sh ├── push-to-store.sh ├── read-only-store.sh ├── readfile-context.nix ├── readfile-context.sh ├── recursive.nix ├── recursive.sh ├── referrers.sh ├── remote-store.sh ├── repair.sh ├── repl.sh ├── repl │ ├── characterisation │ │ └── empty │ ├── doc-comment-curried-args.expected │ ├── doc-comment-curried-args.in │ ├── doc-comment-formals.expected │ ├── doc-comment-formals.in │ ├── doc-comment-function.expected │ ├── doc-comment-function.in │ ├── doc-comment-function.nix │ ├── doc-comments.nix │ ├── doc-compact.expected │ ├── doc-compact.in │ ├── doc-constant.expected │ ├── doc-constant.in │ ├── doc-floatedIn.expected │ ├── doc-floatedIn.in │ ├── doc-functor.expected │ ├── doc-functor.in │ ├── doc-functor.nix │ ├── doc-lambda-flavors.expected │ ├── doc-lambda-flavors.in │ ├── doc-measurement.expected │ ├── doc-measurement.in │ ├── doc-multiply.expected │ ├── doc-multiply.in │ ├── doc-unambiguous.expected │ ├── doc-unambiguous.in │ ├── pretty-print-idempotent.expected │ ├── pretty-print-idempotent.in │ └── pretty-print-idempotent.nix ├── restricted.nix ├── restricted.sh ├── search.nix ├── search.sh ├── secure-drv-outputs.nix ├── secure-drv-outputs.sh ├── selfref-gc.sh ├── shell-hello.nix ├── shell.nix ├── shell.sh ├── shell.shebang.expr ├── shell.shebang.legacy.expr ├── shell.shebang.nix ├── shell.shebang.rb ├── shell.shebang.sh ├── signing.sh ├── simple-failing.nix ├── simple.builder.sh ├── simple.nix ├── simple.sh ├── slash.nar ├── ssh-relay.sh ├── store-info.sh ├── structured-attrs-shell.nix ├── structured-attrs.nix ├── structured-attrs.sh ├── substitute-with-invalid-ca.sh ├── suggestions.sh ├── supplementary-groups.sh ├── symlink-derivation.nix ├── symlinks.sh ├── tarball.sh ├── test-infra.sh ├── test-libstoreconsumer.sh ├── test-libstoreconsumer │ ├── README.md │ ├── main.cc │ └── meson.build ├── timeout.nix ├── timeout.sh ├── toString-path.sh ├── tree.tar.gz ├── undefined-variable.nix ├── unnormalized.nar ├── user-envs-migration.sh ├── user-envs-test-case.sh ├── user-envs.builder.sh ├── user-envs.nix ├── user-envs.sh ├── why-depends.sh └── zstd.sh ├── installer ├── default.nix └── vagrant_insecure_key ├── nixos ├── authorization.nix ├── ca-fd-leak │ ├── default.nix │ ├── sender.c │ └── smuggler.c ├── cgroups │ ├── default.nix │ └── hang.nix ├── chroot-store.nix ├── containers │ ├── containers.nix │ ├── id-test.nix │ └── systemd-nspawn.nix ├── default.nix ├── fetch-git │ ├── default.nix │ ├── test-cases │ │ ├── fetchTree-shallow │ │ │ └── default.nix │ │ ├── http-auth │ │ │ └── default.nix │ │ ├── http-simple │ │ │ └── default.nix │ │ ├── lfs │ │ │ └── default.nix │ │ ├── shallow-cache-separation │ │ │ └── default.nix │ │ ├── shallow-ignore-ref │ │ │ └── default.nix │ │ ├── ssh-shallow │ │ │ └── default.nix │ │ └── ssh-simple │ │ │ └── default.nix │ └── testsupport │ │ ├── gitea-repo.nix │ │ ├── gitea.nix │ │ └── setup.nix ├── fetchurl.nix ├── fsync.nix ├── functional │ ├── as-root.nix │ ├── as-trusted-user.nix │ ├── as-user.nix │ ├── common.nix │ └── symlinked-home.nix ├── git-submodules.nix ├── github-flakes.nix ├── gzip-content-encoding.nix ├── nix-copy-closure.nix ├── nix-copy.nix ├── nix-docker-test.sh ├── nix-docker.nix ├── nss-preload.nix ├── remote-builds-ssh-ng.nix ├── remote-builds.nix ├── s3-binary-cache-store.nix ├── setuid.nix ├── sourcehut-flakes.nix ├── tarball-flakes.nix └── user-sandboxing │ ├── attacker.c │ └── default.nix └── repl-completion.nix /.clang-tidy: -------------------------------------------------------------------------------- 1 | # We use pointers to aggregates in a couple of places, intentionally. 2 | # void * would look weird. 3 | Checks: '-bugprone-sizeof-expression' 4 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Configuration for probot-stale - https://github.com/probot/stale 2 | daysUntilStale: 180 3 | daysUntilClose: false 4 | exemptLabels: 5 | - "critical" 6 | - "never-stale" 7 | staleLabel: "stale" 8 | markComment: false 9 | closeComment: false 10 | -------------------------------------------------------------------------------- /.shellcheckrc: -------------------------------------------------------------------------------- 1 | external-sources=true 2 | source-path=SCRIPTDIR 3 | # Hack for scripts in e.g. tests/functional/ca 4 | source-path=SCRIPTDIR/.. 5 | -------------------------------------------------------------------------------- /.version: -------------------------------------------------------------------------------- 1 | 2.30.0 2 | -------------------------------------------------------------------------------- /HACKING.md: -------------------------------------------------------------------------------- 1 | doc/manual/source/development/building.md -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | (import ( 2 | let 3 | lock = builtins.fromJSON (builtins.readFile ./flake.lock); 4 | in 5 | fetchTarball { 6 | url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; 7 | sha256 = lock.nodes.flake-compat.locked.narHash; 8 | } 9 | ) { src = ./.; }).defaultNix 10 | -------------------------------------------------------------------------------- /doc/manual/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /doc/manual/generate-xp-features-shortlist.nix: -------------------------------------------------------------------------------- 1 | with builtins; 2 | with import ; 3 | 4 | let 5 | showExperimentalFeature = name: doc: '' 6 | - [`${name}`](@docroot@/development/experimental-features.md#xp-feature-${name}) 7 | ''; 8 | in 9 | xps: indent " " (concatStrings (attrValues (mapAttrs showExperimentalFeature xps))) 10 | -------------------------------------------------------------------------------- /doc/manual/generate-xp-features.nix: -------------------------------------------------------------------------------- 1 | with builtins; 2 | with import ; 3 | 4 | let 5 | showExperimentalFeature = 6 | name: doc: 7 | squash '' 8 | ## [`${name}`]{#xp-feature-${name}} 9 | 10 | ${doc} 11 | ''; 12 | in 13 | 14 | xps: (concatStringsSep "\n" (attrValues (mapAttrs showExperimentalFeature xps))) 15 | -------------------------------------------------------------------------------- /doc/manual/rl-next/config: -------------------------------------------------------------------------------- 1 | organization: NixOS 2 | repository: nix 3 | -------------------------------------------------------------------------------- /doc/manual/rl-next/json-logger.md: -------------------------------------------------------------------------------- 1 | --- 2 | synopsis: "`json-log-path` setting" 3 | prs: [13003] 4 | --- 5 | 6 | New setting `json-log-path` that sends a copy of all Nix log messages (in JSON format) to a file or Unix domain socket. 7 | -------------------------------------------------------------------------------- /doc/manual/source/advanced-topics/index.md: -------------------------------------------------------------------------------- 1 | This section lists advanced topics related to builds and builds performance 2 | -------------------------------------------------------------------------------- /doc/manual/source/command-ref/experimental-commands.md: -------------------------------------------------------------------------------- 1 | # Experimental Commands 2 | 3 | This section lists [experimental commands](@docroot@/development/experimental-features.md#xp-feature-nix-command). 4 | 5 | > **Warning** 6 | > 7 | > These commands may be removed in the future, or their syntax may 8 | > change in incompatible ways. 9 | -------------------------------------------------------------------------------- /doc/manual/source/command-ref/files.md: -------------------------------------------------------------------------------- 1 | # Files 2 | 3 | This section lists configuration files that you can use when you work 4 | with Nix. 5 | -------------------------------------------------------------------------------- /doc/manual/source/command-ref/index.md: -------------------------------------------------------------------------------- 1 | This section lists commands and options that you can use when you work 2 | with Nix. 3 | -------------------------------------------------------------------------------- /doc/manual/source/command-ref/main-commands.md: -------------------------------------------------------------------------------- 1 | # Main Commands 2 | 3 | This section lists commands and options that you can use when you work 4 | with Nix. 5 | -------------------------------------------------------------------------------- /doc/manual/source/command-ref/nix-daemon.md: -------------------------------------------------------------------------------- 1 | # Name 2 | 3 | `nix-daemon` - Nix multi-user support daemon 4 | 5 | # Synopsis 6 | 7 | `nix-daemon` 8 | 9 | # Description 10 | 11 | The Nix daemon is necessary in multi-user Nix installations. It runs 12 | build tasks and other operations on the Nix store on behalf of 13 | unprivileged users. 14 | -------------------------------------------------------------------------------- /doc/manual/source/command-ref/nix-env/env-common.md: -------------------------------------------------------------------------------- 1 | # Environment variables 2 | 3 | - `NIX_PROFILE` 4 | 5 | Location of the Nix profile. Defaults to the target of the symlink 6 | `~/.nix-profile`, if it exists, or `/nix/var/nix/profiles/default` 7 | otherwise. 8 | -------------------------------------------------------------------------------- /doc/manual/source/command-ref/utilities.md: -------------------------------------------------------------------------------- 1 | # Utilities 2 | 3 | This section lists utilities that you can use when you work with Nix. 4 | -------------------------------------------------------------------------------- /doc/manual/source/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/doc/manual/source/favicon.png -------------------------------------------------------------------------------- /doc/manual/source/figures/user-environments.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/doc/manual/source/figures/user-environments.png -------------------------------------------------------------------------------- /doc/manual/source/figures/user-environments.sxd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/doc/manual/source/figures/user-environments.sxd -------------------------------------------------------------------------------- /doc/manual/source/installation/installing-source.md: -------------------------------------------------------------------------------- 1 | # Installing Nix from Source 2 | 3 | If no binary package is available or if you want to hack on Nix, you 4 | can build Nix from its Git repository. 5 | -------------------------------------------------------------------------------- /doc/manual/source/installation/supported-platforms.md: -------------------------------------------------------------------------------- 1 | # Supported Platforms 2 | 3 | Nix is currently supported on the following platforms: 4 | 5 | - Linux (i686, x86\_64, aarch64). 6 | 7 | - macOS (x86\_64, aarch64). 8 | -------------------------------------------------------------------------------- /doc/manual/source/language/builtins-suffix.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /doc/manual/source/language/constructs.md: -------------------------------------------------------------------------------- 1 | # Language Constructs 2 | -------------------------------------------------------------------------------- /doc/manual/source/language/values.md: -------------------------------------------------------------------------------- 1 | # Data Types 2 | -------------------------------------------------------------------------------- /doc/manual/source/package-management/index.md: -------------------------------------------------------------------------------- 1 | This chapter discusses how to do package management with Nix, i.e., 2 | how to obtain, install, upgrade, and erase packages. This is the 3 | “user’s” perspective of the Nix system — people who want to *create* 4 | packages should consult the chapter on the [Nix language](../language/index.md). 5 | -------------------------------------------------------------------------------- /doc/manual/source/protocols/index.md: -------------------------------------------------------------------------------- 1 | # Protocols 2 | 3 | This chapter documents various developer-facing interfaces provided by 4 | Nix. 5 | -------------------------------------------------------------------------------- /doc/manual/source/protocols/json/index.md: -------------------------------------------------------------------------------- 1 | # JSON Formats 2 | -------------------------------------------------------------------------------- /doc/manual/source/release-notes/rl-0.10.1.md: -------------------------------------------------------------------------------- 1 | # Release 0.10.1 (2006-10-11) 2 | 3 | This release fixes two somewhat obscure bugs that occur when evaluating 4 | Nix expressions that are stored inside the Nix store (`NIX-67`). These 5 | do not affect most users. 6 | -------------------------------------------------------------------------------- /doc/manual/source/release-notes/rl-0.15.md: -------------------------------------------------------------------------------- 1 | # Release 0.15 (2010-03-17) 2 | 3 | This is a bug-fix release. Among other things, it fixes building on Mac 4 | OS X (Snow Leopard), and improves the contents of `/etc/passwd` and 5 | `/etc/group` in `chroot` builds. 6 | -------------------------------------------------------------------------------- /doc/manual/source/release-notes/rl-0.5.md: -------------------------------------------------------------------------------- 1 | # Release 0.5 and earlier 2 | 3 | Please refer to the Subversion commit log messages. 4 | -------------------------------------------------------------------------------- /doc/manual/source/release-notes/rl-0.8.1.md: -------------------------------------------------------------------------------- 1 | # Release 0.8.1 (2005-04-13) 2 | 3 | This is a bug fix release. 4 | 5 | - Patch downloading was broken. 6 | 7 | - The garbage collector would not delete paths that had references 8 | from invalid (but substitutable) paths. 9 | -------------------------------------------------------------------------------- /doc/manual/source/release-notes/rl-0.9.1.md: -------------------------------------------------------------------------------- 1 | # Release 0.9.1 (2005-09-20) 2 | 3 | This bug fix release addresses a problem with the ATerm library when the 4 | `--with-aterm` flag in `configure` was *not* used. 5 | -------------------------------------------------------------------------------- /doc/manual/source/release-notes/rl-1.5.1.md: -------------------------------------------------------------------------------- 1 | # Release 1.5.1 (2013-02-28) 2 | 3 | The bug fix to the bug fix had a bug itself, of course. But this time it 4 | will work for sure\! 5 | -------------------------------------------------------------------------------- /doc/manual/source/release-notes/rl-1.5.2.md: -------------------------------------------------------------------------------- 1 | # Release 1.5.2 (2013-05-13) 2 | 3 | This is primarily a bug fix release. It has contributions from Eelco 4 | Dolstra, Lluís Batlle i Rossell and Shea Levy. 5 | -------------------------------------------------------------------------------- /doc/manual/source/release-notes/rl-1.5.md: -------------------------------------------------------------------------------- 1 | # Release 1.5 (2013-02-27) 2 | 3 | This is a brown paper bag release to fix a regression introduced by the 4 | hard link security fix in 1.4. 5 | -------------------------------------------------------------------------------- /doc/manual/source/release-notes/rl-2.11.md: -------------------------------------------------------------------------------- 1 | # Release 2.11 (2022-08-24) 2 | 3 | * `nix copy` now copies the store paths in parallel as much as possible (again). 4 | This doesn't apply for the `daemon` and `ssh-ng` stores which copy everything 5 | in one batch to avoid latencies issues. 6 | -------------------------------------------------------------------------------- /maintainers/onboarding.md: -------------------------------------------------------------------------------- 1 | 2 | # Onboarding a new team member 3 | 4 | - https://github.com/NixOS/nixos-homepage/ 5 | - https://github.com/orgs/NixOS/teams/nix-team 6 | - Matrix room 7 | - Team member should subscribe to notifications for the [Nix development category on Discourse](https://discourse.nixos.org/c/dev/nix/50) 8 | -------------------------------------------------------------------------------- /misc/bash/meson.build: -------------------------------------------------------------------------------- 1 | configure_file( 2 | input : 'completion.sh', 3 | output : 'nix', 4 | install : true, 5 | install_dir : get_option('datadir') / 'bash-completion' / 'completions', 6 | install_mode : 'rw-r--r--', 7 | copy : true, 8 | ) 9 | -------------------------------------------------------------------------------- /misc/fish/meson.build: -------------------------------------------------------------------------------- 1 | configure_file( 2 | input : 'completion.fish', 3 | output : 'nix.fish', 4 | install : true, 5 | install_dir : get_option('datadir') / 'fish' / 'vendor_completions.d', 6 | install_mode : 'rw-r--r--', 7 | copy : true, 8 | ) 9 | -------------------------------------------------------------------------------- /misc/meson.build: -------------------------------------------------------------------------------- 1 | subdir('bash') 2 | subdir('fish') 3 | subdir('zsh') 4 | 5 | if host_machine.system() == 'linux' 6 | subdir('systemd') 7 | endif 8 | 9 | if host_machine.system() == 'darwin' 10 | subdir('launchd') 11 | endif 12 | -------------------------------------------------------------------------------- /misc/systemd/nix-daemon.conf.in: -------------------------------------------------------------------------------- 1 | d @localstatedir@/nix/daemon-socket 0755 root root - - 2 | -------------------------------------------------------------------------------- /misc/systemd/nix-daemon.socket.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Nix Daemon Socket 3 | Before=multi-user.target 4 | RequiresMountsFor=@storedir@ 5 | ConditionPathIsReadWrite=@localstatedir@/nix/daemon-socket 6 | 7 | [Socket] 8 | ListenStream=@localstatedir@/nix/daemon-socket/socket 9 | 10 | [Install] 11 | WantedBy=sockets.target 12 | -------------------------------------------------------------------------------- /misc/upstart/nix-daemon.conf.in: -------------------------------------------------------------------------------- 1 | description "Nix Daemon" 2 | start on filesystem 3 | stop on shutdown 4 | respawn 5 | exec @bindir@/nix-daemon --daemon 6 | -------------------------------------------------------------------------------- /misc/zsh/meson.build: -------------------------------------------------------------------------------- 1 | foreach script : [ [ 'completion.zsh', '_nix' ], [ 'run-help-nix' ] ] 2 | configure_file( 3 | input : script[0], 4 | output : script.get(1, script[0]), 5 | install : true, 6 | install_dir : get_option('datadir') / 'zsh/site-functions', 7 | install_mode : 'rw-r--r--', 8 | copy : true, 9 | ) 10 | endforeach 11 | -------------------------------------------------------------------------------- /nix-meson-build-support/generate-header/meson.build: -------------------------------------------------------------------------------- 1 | bash = find_program('bash', native: true) 2 | 3 | gen_header = generator( 4 | bash, 5 | arguments : [ '-c', '{ echo \'R"__NIX_STR(\' && cat @INPUT@ && echo \')__NIX_STR"\'; } > "$1"', '_ignored_argv0', '@OUTPUT@' ], 6 | output : '@PLAINNAME@.gen.hh', 7 | ) 8 | -------------------------------------------------------------------------------- /nix-meson-build-support/libatomic/meson.build: -------------------------------------------------------------------------------- 1 | 2 | # Check if -latomic is needed 3 | # This is needed for std::atomic on some platforms 4 | # We did not manage to test this reliably on all platforms, so we hardcode 5 | # it for now. 6 | if host_machine.cpu_family() == 'arm' 7 | deps_other += cxx.find_library('atomic') 8 | endif 9 | -------------------------------------------------------------------------------- /scripts/build-checks: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | system=$(nix eval --raw --impure --expr builtins.currentSystem) 4 | nix eval --json ".#checks.$system" --apply builtins.attrNames | \ 5 | jq -r '.[]' | \ 6 | xargs -P0 -I '{}' sh -c "nix build -L .#checks.$system.{} || { echo 'FAILED: \033[0;31mnix build -L .#checks.$system.{}\\033[0m'; kill 0; }" 7 | -------------------------------------------------------------------------------- /scripts/prepare-installer-for-github-actions: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | nix build -L ".#installerScriptForGHA" ".#binaryTarball" 6 | 7 | mkdir -p out 8 | cp ./result/install "out/install" 9 | name="$(basename "$(realpath ./result-1)")" 10 | # everything before the first dash 11 | cp -r ./result-1 "out/${name%%-*}" 12 | -------------------------------------------------------------------------------- /shell.nix: -------------------------------------------------------------------------------- 1 | (import (fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz") { 2 | src = ./.; 3 | }).shellNix 4 | -------------------------------------------------------------------------------- /src/external-api-docs/.gitignore: -------------------------------------------------------------------------------- 1 | /doxygen.cfg 2 | /html 3 | /latex 4 | -------------------------------------------------------------------------------- /src/external-api-docs/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/internal-api-docs/.gitignore: -------------------------------------------------------------------------------- 1 | /doxygen.cfg 2 | /html 3 | /latex 4 | -------------------------------------------------------------------------------- /src/internal-api-docs/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libcmd/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libcmd/command-installable-value.cc: -------------------------------------------------------------------------------- 1 | #include "nix/cmd/command-installable-value.hh" 2 | 3 | namespace nix { 4 | 5 | void InstallableValueCommand::run(ref store, ref installable) 6 | { 7 | auto installableValue = InstallableValue::require(installable); 8 | run(store, installableValue); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/libcmd/include/nix/cmd/editor-for.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | ///@file 3 | 4 | #include "nix/util/types.hh" 5 | #include "nix/util/source-path.hh" 6 | 7 | namespace nix { 8 | 9 | /** 10 | * Helper function to generate args that invoke $EDITOR on 11 | * filename:lineno. 12 | */ 13 | Strings editorFor(const SourcePath & file, uint32_t line); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/libcmd/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libexpr-c/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libexpr-c/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libexpr-test-support/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libexpr-test-support/include/nix/expr/tests/meson.build: -------------------------------------------------------------------------------- 1 | # Public headers directory 2 | 3 | include_dirs = [include_directories('../../..')] 4 | 5 | headers = files( 6 | 'libexpr.hh', 7 | 'nix_api_expr.hh', 8 | 'value/context.hh', 9 | ) 10 | -------------------------------------------------------------------------------- /src/libexpr-test-support/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libexpr-tests/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libexpr-tests/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/src/libexpr-tests/data/.gitkeep -------------------------------------------------------------------------------- /src/libexpr-tests/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libexpr/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libexpr/include/nix/expr/json-to-value.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | ///@file 3 | 4 | #include "nix/util/error.hh" 5 | 6 | #include 7 | 8 | namespace nix { 9 | 10 | class EvalState; 11 | struct Value; 12 | 13 | MakeError(JSONParseError, Error); 14 | 15 | void parseJSON(EvalState & state, const std::string_view & s, Value & v); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/libexpr/meson.options: -------------------------------------------------------------------------------- 1 | option('gc', type : 'feature', 2 | description : 'enable garbage collection in the Nix expression evaluator (requires Boehm GC)', 3 | ) 4 | -------------------------------------------------------------------------------- /src/libexpr/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libexpr/primops/meson.build: -------------------------------------------------------------------------------- 1 | generated_headers += gen_header.process( 2 | 'derivation.nix', 3 | preserve_path_from: meson.project_source_root(), 4 | ) 5 | 6 | sources += files( 7 | 'context.cc', 8 | 'fetchClosure.cc', 9 | 'fetchMercurial.cc', 10 | 'fetchTree.cc', 11 | 'fromTOML.cc', 12 | ) 13 | -------------------------------------------------------------------------------- /src/libfetchers-c/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libfetchers-c/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libfetchers-c/nix_api_fetchers_internal.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "nix/fetchers/fetch-settings.hh" 3 | #include "nix/util/ref.hh" 4 | 5 | /** 6 | * A shared reference to `nix::fetchers::Settings` 7 | * @see nix::fetchers::Settings 8 | */ 9 | struct nix_fetchers_settings 10 | { 11 | nix::ref settings; 12 | }; 13 | -------------------------------------------------------------------------------- /src/libfetchers-tests/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libfetchers-tests/data/public-key/defaultType.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "ABCDE", 3 | "type": "ssh-ed25519" 4 | } 5 | -------------------------------------------------------------------------------- /src/libfetchers-tests/data/public-key/noRoundTrip.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "ABCDE" 3 | } 4 | -------------------------------------------------------------------------------- /src/libfetchers-tests/data/public-key/simple.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "ABCDE", 3 | "type": "ssh-rsa" 4 | } 5 | -------------------------------------------------------------------------------- /src/libfetchers-tests/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libfetchers/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libfetchers/fetch-settings.cc: -------------------------------------------------------------------------------- 1 | #include "nix/fetchers/fetch-settings.hh" 2 | 3 | namespace nix::fetchers { 4 | 5 | Settings::Settings() 6 | { 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/libfetchers/include/nix/fetchers/store-path-accessor.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "nix/util/source-path.hh" 4 | 5 | namespace nix { 6 | 7 | class StorePath; 8 | class Store; 9 | 10 | ref makeStorePathAccessor(ref store, const StorePath & storePath); 11 | 12 | SourcePath getUnfilteredRootPath(CanonPath path); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/libfetchers/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libfetchers/store-path-accessor.cc: -------------------------------------------------------------------------------- 1 | #include "nix/fetchers/store-path-accessor.hh" 2 | #include "nix/store/store-api.hh" 3 | 4 | namespace nix { 5 | 6 | ref makeStorePathAccessor(ref store, const StorePath & storePath) 7 | { 8 | return projectSubdirSourceAccessor(store->getFSAccessor(), storePath.to_string()); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/libflake-c/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libflake-c/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libflake-tests/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libflake-tests/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/src/libflake-tests/data/.gitkeep -------------------------------------------------------------------------------- /src/libflake-tests/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libflake/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libflake/include/nix/flake/meson.build: -------------------------------------------------------------------------------- 1 | # Public headers directory 2 | 3 | include_dirs = [include_directories('../..')] 4 | 5 | headers = files( 6 | 'flake.hh', 7 | 'flakeref.hh', 8 | 'lockfile.hh', 9 | 'settings.hh', 10 | 'url-name.hh', 11 | ) 12 | -------------------------------------------------------------------------------- /src/libflake/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libmain-c/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libmain-c/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libmain/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libmain/include/nix/main/meson.build: -------------------------------------------------------------------------------- 1 | # Public headers directory 2 | 3 | include_dirs = [include_directories('../..')] 4 | 5 | headers = files( 6 | 'common-args.hh', 7 | 'loggers.hh', 8 | 'plugin.hh', 9 | 'progress-bar.hh', 10 | 'shared.hh', 11 | ) 12 | -------------------------------------------------------------------------------- /src/libmain/include/nix/main/plugin.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | ///@file 3 | 4 | namespace nix { 5 | 6 | /** 7 | * This should be called after settings are initialized, but before 8 | * anything else 9 | */ 10 | void initPlugins(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/libmain/include/nix/main/progress-bar.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | ///@file 3 | 4 | #include "nix/util/logging.hh" 5 | 6 | namespace nix { 7 | 8 | std::unique_ptr makeProgressBar(); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/libmain/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libstore-c/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libstore-c/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libstore-c/nix_api_store_internal.h: -------------------------------------------------------------------------------- 1 | #ifndef NIX_API_STORE_INTERNAL_H 2 | #define NIX_API_STORE_INTERNAL_H 3 | #include "nix/store/store-api.hh" 4 | 5 | struct Store 6 | { 7 | nix::ref ptr; 8 | }; 9 | 10 | struct StorePath 11 | { 12 | nix::StorePath path; 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/libstore-test-support/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libstore-test-support/include/nix/store/tests/meson.build: -------------------------------------------------------------------------------- 1 | # Public headers directory 2 | 3 | include_dirs = [include_directories('../../..')] 4 | 5 | headers = files( 6 | 'derived-path.hh', 7 | 'libstore.hh', 8 | 'nix_api_store.hh', 9 | 'outputs-spec.hh', 10 | 'path.hh', 11 | 'protocol.hh', 12 | ) 13 | -------------------------------------------------------------------------------- /src/libstore-test-support/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libstore-tests/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libstore-tests/data/common-protocol/content-address.bin: -------------------------------------------------------------------------------- 1 | @text:sha256:1vb2xd67750jrvqgykxrf5ipl3h1q57sxc57q5nzjw56bqp3sxzr+fixed:sha1:1amk6n7wxjlw4qkq6dcj6mm7hw3acrw0Cfixed:r:sha256:1lr187v6dck1rjh2j6svpikcfz53wyl3qrlcbb405zlh13x0khhh -------------------------------------------------------------------------------- /src/libstore-tests/data/common-protocol/drv-output.bin: -------------------------------------------------------------------------------- 1 | Ksha256:15e3c560894cbb27085cf65b5a2ecb18488c999497f4531b6907a7581ce6d527!bazLsha256:6f869f9ea2823bda165e06076fd0de4366dead2c0e8d2dbbad277d4f15c373f5!quux -------------------------------------------------------------------------------- /src/libstore-tests/data/common-protocol/optional-content-address.bin: -------------------------------------------------------------------------------- 1 | +fixed:sha1:1amk6n7wxjlw4qkq6dcj6mm7hw3acrw0 -------------------------------------------------------------------------------- /src/libstore-tests/data/common-protocol/optional-store-path.bin: -------------------------------------------------------------------------------- 1 | 3/nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo-bar -------------------------------------------------------------------------------- /src/libstore-tests/data/common-protocol/realisation.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/src/libstore-tests/data/common-protocol/realisation.bin -------------------------------------------------------------------------------- /src/libstore-tests/data/common-protocol/set.bin: -------------------------------------------------------------------------------- 1 | barfoo12 -------------------------------------------------------------------------------- /src/libstore-tests/data/common-protocol/store-path.bin: -------------------------------------------------------------------------------- 1 | //nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo3/nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo-bar -------------------------------------------------------------------------------- /src/libstore-tests/data/common-protocol/string.bin: -------------------------------------------------------------------------------- 1 | hi white rabbit 大白兔oh no -------------------------------------------------------------------------------- /src/libstore-tests/data/common-protocol/vector.bin: -------------------------------------------------------------------------------- 1 | foobar12 -------------------------------------------------------------------------------- /src/libstore-tests/data/derivation/bad-old-version-dyn-deps.drv: -------------------------------------------------------------------------------- 1 | Derive([],[("/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep2.drv",(["cat","dog"],[("cat",["kitten"]),("goose",["gosling"])]))],["/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep1"],"wasm-sel4","foo",["bar","baz"],[("BIG_BAD","WOLF")]) -------------------------------------------------------------------------------- /src/libstore-tests/data/derivation/bad-version.drv: -------------------------------------------------------------------------------- 1 | DrvWithVersion("invalid-version",[],[("/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep2.drv",["cat","dog"])],["/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep1"],"wasm-sel4","foo",["bar","baz"],[("BIG_BAD","WOLF")]) -------------------------------------------------------------------------------- /src/libstore-tests/data/derivation/ca/advanced-attributes-defaults.drv: -------------------------------------------------------------------------------- 1 | ../../../../../tests/functional/derivation/ca/advanced-attributes-defaults.drv -------------------------------------------------------------------------------- /src/libstore-tests/data/derivation/ca/advanced-attributes-structured-attrs-defaults.drv: -------------------------------------------------------------------------------- 1 | ../../../../../tests/functional/derivation/ca/advanced-attributes-structured-attrs-defaults.drv -------------------------------------------------------------------------------- /src/libstore-tests/data/derivation/ca/advanced-attributes-structured-attrs.drv: -------------------------------------------------------------------------------- 1 | ../../../../../tests/functional/derivation/ca/advanced-attributes-structured-attrs.drv -------------------------------------------------------------------------------- /src/libstore-tests/data/derivation/ca/advanced-attributes.drv: -------------------------------------------------------------------------------- 1 | ../../../../../tests/functional/derivation/ca/advanced-attributes.drv -------------------------------------------------------------------------------- /src/libstore-tests/data/derivation/dynDerivationDeps.drv: -------------------------------------------------------------------------------- 1 | DrvWithVersion("xp-dyn-drv",[],[("/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep2.drv",(["cat","dog"],[("cat",["kitten"]),("goose",["gosling"])]))],["/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep1"],"wasm-sel4","foo",["bar","baz"],[("BIG_BAD","WOLF")]) -------------------------------------------------------------------------------- /src/libstore-tests/data/derivation/ia/advanced-attributes-defaults.drv: -------------------------------------------------------------------------------- 1 | ../../../../../tests/functional/derivation/ia/advanced-attributes-defaults.drv -------------------------------------------------------------------------------- /src/libstore-tests/data/derivation/ia/advanced-attributes-structured-attrs-defaults.drv: -------------------------------------------------------------------------------- 1 | ../../../../../tests/functional/derivation/ia/advanced-attributes-structured-attrs-defaults.drv -------------------------------------------------------------------------------- /src/libstore-tests/data/derivation/ia/advanced-attributes-structured-attrs.drv: -------------------------------------------------------------------------------- 1 | ../../../../../tests/functional/derivation/ia/advanced-attributes-structured-attrs.drv -------------------------------------------------------------------------------- /src/libstore-tests/data/derivation/ia/advanced-attributes.drv: -------------------------------------------------------------------------------- 1 | ../../../../../tests/functional/derivation/ia/advanced-attributes.drv -------------------------------------------------------------------------------- /src/libstore-tests/data/derivation/output-caFixedFlat.json: -------------------------------------------------------------------------------- 1 | { 2 | "hash": "894517c9163c896ec31a2adbd33c0681fd5f45b2c0ef08a64c92a03fb97f390f", 3 | "hashAlgo": "sha256", 4 | "method": "flat", 5 | "path": "/nix/store/rhcg9h16sqvlbpsa6dqm57sbr2al6nzg-drv-name-output-name" 6 | } 7 | -------------------------------------------------------------------------------- /src/libstore-tests/data/derivation/output-caFixedNAR.json: -------------------------------------------------------------------------------- 1 | { 2 | "hash": "894517c9163c896ec31a2adbd33c0681fd5f45b2c0ef08a64c92a03fb97f390f", 3 | "hashAlgo": "sha256", 4 | "method": "nar", 5 | "path": "/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-drv-name-output-name" 6 | } 7 | -------------------------------------------------------------------------------- /src/libstore-tests/data/derivation/output-caFixedText.json: -------------------------------------------------------------------------------- 1 | { 2 | "hash": "894517c9163c896ec31a2adbd33c0681fd5f45b2c0ef08a64c92a03fb97f390f", 3 | "hashAlgo": "sha256", 4 | "method": "text", 5 | "path": "/nix/store/6s1zwabh956jvhv4w9xcdb5jiyanyxg1-drv-name-output-name" 6 | } 7 | -------------------------------------------------------------------------------- /src/libstore-tests/data/derivation/output-caFloating.json: -------------------------------------------------------------------------------- 1 | { 2 | "hashAlgo": "sha256", 3 | "method": "nar" 4 | } 5 | -------------------------------------------------------------------------------- /src/libstore-tests/data/derivation/output-deferred.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/libstore-tests/data/derivation/output-impure.json: -------------------------------------------------------------------------------- 1 | { 2 | "hashAlgo": "sha256", 3 | "impure": true, 4 | "method": "nar" 5 | } 6 | -------------------------------------------------------------------------------- /src/libstore-tests/data/derivation/output-inputAddressed.json: -------------------------------------------------------------------------------- 1 | { 2 | "path": "/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-drv-name-output-name" 3 | } 4 | -------------------------------------------------------------------------------- /src/libstore-tests/data/derivation/simple.drv: -------------------------------------------------------------------------------- 1 | Derive([],[("/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep2.drv",["cat","dog"])],["/nix/store/c015dhfh5l0lp6wxyvdn7bmwhbbr6hr9-dep1"],"wasm-sel4","foo",["bar","baz"],[("BIG_BAD","WOLF")]) -------------------------------------------------------------------------------- /src/libstore-tests/data/machines/bad_format: -------------------------------------------------------------------------------- 1 | nix@scratchy.labs.cs.uu.nl - - eight 2 | -------------------------------------------------------------------------------- /src/libstore-tests/data/path-info/empty_impure.json: -------------------------------------------------------------------------------- 1 | { 2 | "ca": null, 3 | "deriver": null, 4 | "narHash": "sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc=", 5 | "narSize": 0, 6 | "references": [], 7 | "registrationTime": null, 8 | "signatures": [], 9 | "ultimate": false 10 | } 11 | -------------------------------------------------------------------------------- /src/libstore-tests/data/path-info/empty_pure.json: -------------------------------------------------------------------------------- 1 | { 2 | "ca": null, 3 | "narHash": "sha256-FePFYIlMuycIXPZbWi7LGEiMmZSX9FMbaQenWBzm1Sc=", 4 | "narSize": 0, 5 | "references": [] 6 | } 7 | -------------------------------------------------------------------------------- /src/libstore-tests/data/serve-protocol/build-options-2.1.bin: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /src/libstore-tests/data/serve-protocol/build-options-2.2.bin: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /src/libstore-tests/data/serve-protocol/build-options-2.3.bin: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /src/libstore-tests/data/serve-protocol/build-options-2.7.bin: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /src/libstore-tests/data/serve-protocol/build-result-2.2.bin: -------------------------------------------------------------------------------- 1 |  no idea why no idea why -------------------------------------------------------------------------------- /src/libstore-tests/data/serve-protocol/build-result-2.3.bin: -------------------------------------------------------------------------------- 1 |  no idea why no idea why22 -------------------------------------------------------------------------------- /src/libstore-tests/data/serve-protocol/build-result-2.6.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/src/libstore-tests/data/serve-protocol/build-result-2.6.bin -------------------------------------------------------------------------------- /src/libstore-tests/data/serve-protocol/content-address.bin: -------------------------------------------------------------------------------- 1 | @text:sha256:1vb2xd67750jrvqgykxrf5ipl3h1q57sxc57q5nzjw56bqp3sxzr+fixed:sha1:1amk6n7wxjlw4qkq6dcj6mm7hw3acrw0Cfixed:r:sha256:1lr187v6dck1rjh2j6svpikcfz53wyl3qrlcbb405zlh13x0khhh -------------------------------------------------------------------------------- /src/libstore-tests/data/serve-protocol/drv-output.bin: -------------------------------------------------------------------------------- 1 | Ksha256:15e3c560894cbb27085cf65b5a2ecb18488c999497f4531b6907a7581ce6d527!bazLsha256:6f869f9ea2823bda165e06076fd0de4366dead2c0e8d2dbbad277d4f15c373f5!quux -------------------------------------------------------------------------------- /src/libstore-tests/data/serve-protocol/handshake-to-client.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/src/libstore-tests/data/serve-protocol/handshake-to-client.bin -------------------------------------------------------------------------------- /src/libstore-tests/data/serve-protocol/optional-content-address.bin: -------------------------------------------------------------------------------- 1 | +fixed:sha1:1amk6n7wxjlw4qkq6dcj6mm7hw3acrw0 -------------------------------------------------------------------------------- /src/libstore-tests/data/serve-protocol/optional-store-path.bin: -------------------------------------------------------------------------------- 1 | 3/nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo-bar -------------------------------------------------------------------------------- /src/libstore-tests/data/serve-protocol/realisation.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/src/libstore-tests/data/serve-protocol/realisation.bin -------------------------------------------------------------------------------- /src/libstore-tests/data/serve-protocol/set.bin: -------------------------------------------------------------------------------- 1 | barfoo12 -------------------------------------------------------------------------------- /src/libstore-tests/data/serve-protocol/store-path.bin: -------------------------------------------------------------------------------- 1 | //nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo3/nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo-bar -------------------------------------------------------------------------------- /src/libstore-tests/data/serve-protocol/string.bin: -------------------------------------------------------------------------------- 1 | hi white rabbit 大白兔oh no -------------------------------------------------------------------------------- /src/libstore-tests/data/serve-protocol/unkeyed-valid-path-info-2.3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/src/libstore-tests/data/serve-protocol/unkeyed-valid-path-info-2.3.bin -------------------------------------------------------------------------------- /src/libstore-tests/data/serve-protocol/unkeyed-valid-path-info-2.4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/src/libstore-tests/data/serve-protocol/unkeyed-valid-path-info-2.4.bin -------------------------------------------------------------------------------- /src/libstore-tests/data/serve-protocol/vector.bin: -------------------------------------------------------------------------------- 1 | foobar12 -------------------------------------------------------------------------------- /src/libstore-tests/data/store-reference/auto.txt: -------------------------------------------------------------------------------- 1 | auto -------------------------------------------------------------------------------- /src/libstore-tests/data/store-reference/auto_param.txt: -------------------------------------------------------------------------------- 1 | auto?root=/foo/bar/baz -------------------------------------------------------------------------------- /src/libstore-tests/data/store-reference/local_1.txt: -------------------------------------------------------------------------------- 1 | local://?root=/foo/bar/baz -------------------------------------------------------------------------------- /src/libstore-tests/data/store-reference/local_2.txt: -------------------------------------------------------------------------------- 1 | local:///foo/bar/baz?trusted=true -------------------------------------------------------------------------------- /src/libstore-tests/data/store-reference/local_shorthand_1.txt: -------------------------------------------------------------------------------- 1 | local?root=/foo/bar/baz -------------------------------------------------------------------------------- /src/libstore-tests/data/store-reference/local_shorthand_2.txt: -------------------------------------------------------------------------------- 1 | /foo/bar/baz?trusted=true -------------------------------------------------------------------------------- /src/libstore-tests/data/store-reference/ssh.txt: -------------------------------------------------------------------------------- 1 | ssh://localhost -------------------------------------------------------------------------------- /src/libstore-tests/data/store-reference/unix.txt: -------------------------------------------------------------------------------- 1 | unix://?max-connections=7&trusted=true -------------------------------------------------------------------------------- /src/libstore-tests/data/store-reference/unix_shorthand.txt: -------------------------------------------------------------------------------- 1 | daemon?max-connections=7&trusted=true -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/build-mode.bin: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/build-result-1.27.bin: -------------------------------------------------------------------------------- 1 |  no idea why no idea why -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/build-result-1.28.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/src/libstore-tests/data/worker-protocol/build-result-1.28.bin -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/build-result-1.29.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/src/libstore-tests/data/worker-protocol/build-result-1.29.bin -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/build-result-1.37.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/src/libstore-tests/data/worker-protocol/build-result-1.37.bin -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/client-handshake-info_1_30.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/src/libstore-tests/data/worker-protocol/client-handshake-info_1_30.bin -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/client-handshake-info_1_33.bin: -------------------------------------------------------------------------------- 1 | foobar -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/client-handshake-info_1_35.bin: -------------------------------------------------------------------------------- 1 | foobar -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/content-address.bin: -------------------------------------------------------------------------------- 1 | @text:sha256:1vb2xd67750jrvqgykxrf5ipl3h1q57sxc57q5nzjw56bqp3sxzr+fixed:sha1:1amk6n7wxjlw4qkq6dcj6mm7hw3acrw0Cfixed:r:sha256:1lr187v6dck1rjh2j6svpikcfz53wyl3qrlcbb405zlh13x0khhh -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/derived-path-1.29.bin: -------------------------------------------------------------------------------- 1 | //nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo3/nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar.drv7/nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar.drv!x,y -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/derived-path-1.30.bin: -------------------------------------------------------------------------------- 1 | //nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo3/nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo.drv5/nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar.drv!*7/nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar.drv!x,y -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/drv-output.bin: -------------------------------------------------------------------------------- 1 | Ksha256:15e3c560894cbb27085cf65b5a2ecb18488c999497f4531b6907a7581ce6d527!bazLsha256:6f869f9ea2823bda165e06076fd0de4366dead2c0e8d2dbbad277d4f15c373f5!quux -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/handshake-to-client.bin: -------------------------------------------------------------------------------- 1 | oixd 2 |  -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/keyed-build-result-1.29.bin: -------------------------------------------------------------------------------- 1 | //nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-xxx no idea why7/nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar.drv!out no idea why2 -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/optional-content-address.bin: -------------------------------------------------------------------------------- 1 | +fixed:sha1:1amk6n7wxjlw4qkq6dcj6mm7hw3acrw0 -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/optional-store-path.bin: -------------------------------------------------------------------------------- 1 | 3/nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo-bar -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/optional-trusted-flag.bin: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/realisation.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/src/libstore-tests/data/worker-protocol/realisation.bin -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/set.bin: -------------------------------------------------------------------------------- 1 | barfoo12 -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/store-path.bin: -------------------------------------------------------------------------------- 1 | //nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo3/nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-foo-bar -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/string.bin: -------------------------------------------------------------------------------- 1 | hi white rabbit 大白兔oh no -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/unkeyed-valid-path-info-1.15.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/src/libstore-tests/data/worker-protocol/unkeyed-valid-path-info-1.15.bin -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/valid-path-info-1.15.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/src/libstore-tests/data/worker-protocol/valid-path-info-1.15.bin -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/valid-path-info-1.16.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/src/libstore-tests/data/worker-protocol/valid-path-info-1.16.bin -------------------------------------------------------------------------------- /src/libstore-tests/data/worker-protocol/vector.bin: -------------------------------------------------------------------------------- 1 | foobar12 -------------------------------------------------------------------------------- /src/libstore-tests/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libstore/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libstore/build-result.cc: -------------------------------------------------------------------------------- 1 | #include "nix/store/build-result.hh" 2 | 3 | namespace nix { 4 | 5 | bool BuildResult::operator==(const BuildResult &) const noexcept = default; 6 | std::strong_ordering BuildResult::operator<=>(const BuildResult &) const noexcept = default; 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/libstore/dummy-store.md: -------------------------------------------------------------------------------- 1 | R"( 2 | 3 | **Store URL format**: `dummy://` 4 | 5 | This store type represents a store that contains no store paths and 6 | cannot be written to. It's useful when you want to use the Nix 7 | evaluator when no actual Nix store exists, e.g. 8 | 9 | ```console 10 | # nix eval --store dummy:// --expr '1 + 2' 11 | ``` 12 | 13 | )" 14 | -------------------------------------------------------------------------------- /src/libstore/http-binary-cache-store.md: -------------------------------------------------------------------------------- 1 | R"( 2 | 3 | **Store URL format**: `http://...`, `https://...` 4 | 5 | This store allows a binary cache to be accessed via the HTTP 6 | protocol. 7 | 8 | )" 9 | -------------------------------------------------------------------------------- /src/libstore/include/nix/store/keys.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | ///@file 3 | 4 | #include "nix/util/signature/local-keys.hh" 5 | 6 | namespace nix { 7 | 8 | PublicKeys getDefaultPublicKeys(); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/libstore/legacy-ssh-store.md: -------------------------------------------------------------------------------- 1 | R"( 2 | 3 | **Store URL format**: `ssh://[username@]hostname` 4 | 5 | This store type allows limited access to a remote store on another 6 | machine via SSH. 7 | 8 | )" 9 | -------------------------------------------------------------------------------- /src/libstore/linux/include/nix/store/meson.build: -------------------------------------------------------------------------------- 1 | include_dirs += include_directories('../..') 2 | 3 | headers += files( 4 | 'personality.hh', 5 | ) 6 | -------------------------------------------------------------------------------- /src/libstore/linux/include/nix/store/personality.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | ///@file 3 | 4 | #include 5 | 6 | namespace nix::linux { 7 | 8 | void setPersonality(std::string_view system); 9 | 10 | } 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/libstore/linux/meson.build: -------------------------------------------------------------------------------- 1 | sources += files( 2 | 'personality.cc', 3 | ) 4 | 5 | subdir('include/nix/store') 6 | -------------------------------------------------------------------------------- /src/libstore/log-store.cc: -------------------------------------------------------------------------------- 1 | #include "nix/store/log-store.hh" 2 | 3 | namespace nix { 4 | 5 | std::optional LogStore::getBuildLog(const StorePath & path) { 6 | auto maybePath = getBuildDerivationPath(path); 7 | if (!maybePath) 8 | return std::nullopt; 9 | return getBuildLogExact(maybePath.value()); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/libstore/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libstore/ssh-store.md: -------------------------------------------------------------------------------- 1 | R"( 2 | 3 | **Store URL format**: `ssh-ng://[username@]hostname` 4 | 5 | Experimental store type that allows full access to a Nix store on a 6 | remote machine. 7 | 8 | )" 9 | -------------------------------------------------------------------------------- /src/libstore/store-dir-config.cc: -------------------------------------------------------------------------------- 1 | #include "nix/store/store-dir-config.hh" 2 | #include "nix/util/util.hh" 3 | #include "nix/store/globals.hh" 4 | 5 | namespace nix { 6 | 7 | StoreDirConfig::StoreDirConfig(const Params & params) 8 | : StoreDirConfigBase(params) 9 | , MixStoreDirMethods{storeDir_} 10 | { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/libstore/uds-remote-store.md: -------------------------------------------------------------------------------- 1 | R"( 2 | 3 | **Store URL format**: `daemon`, `unix://`*path* 4 | 5 | This store type accesses a Nix store by talking to a Nix daemon 6 | listening on the Unix domain socket *path*. The store pseudo-URL 7 | `daemon` is equivalent to `unix:///nix/var/nix/daemon-socket/socket`. 8 | 9 | )" 10 | -------------------------------------------------------------------------------- /src/libstore/unix/build/sandbox-minimal.sb: -------------------------------------------------------------------------------- 1 | R""( 2 | 3 | (allow default) 4 | 5 | ; Disallow creating setuid/setgid binaries, since that 6 | ; would allow breaking build user isolation. 7 | (deny file-write-setugid) 8 | 9 | )"" 10 | -------------------------------------------------------------------------------- /src/libstore/unix/include/nix/store/build/child.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | ///@file 3 | 4 | namespace nix { 5 | 6 | /** 7 | * Common initialisation performed in child processes. 8 | */ 9 | void commonChildInit(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/libstore/unix/include/nix/store/meson.build: -------------------------------------------------------------------------------- 1 | include_dirs += include_directories('../..') 2 | 3 | headers += files( 4 | 'build/child.hh', 5 | 'build/derivation-builder.hh', 6 | 'build/hook-instance.hh', 7 | 'user-lock.hh', 8 | ) 9 | -------------------------------------------------------------------------------- /src/libstore/unix/meson.build: -------------------------------------------------------------------------------- 1 | sources += files( 2 | 'build/child.cc', 3 | 'build/derivation-builder.cc', 4 | 'build/hook-instance.cc', 5 | 'pathlocks.cc', 6 | 'user-lock.cc', 7 | ) 8 | 9 | subdir('include/nix/store') 10 | -------------------------------------------------------------------------------- /src/libstore/windows/meson.build: -------------------------------------------------------------------------------- 1 | sources += files( 2 | 'pathlocks.cc', 3 | ) 4 | 5 | include_dirs += include_directories( 6 | '.', 7 | #'build', 8 | ) 9 | 10 | headers += files( 11 | ) 12 | -------------------------------------------------------------------------------- /src/libutil-c/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libutil-c/meson.options: -------------------------------------------------------------------------------- 1 | # vim: filetype=meson 2 | -------------------------------------------------------------------------------- /src/libutil-c/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libutil-test-support/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libutil-test-support/include/nix/util/tests/hash.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | ///@file 3 | 4 | #include 5 | 6 | #include "nix/util/hash.hh" 7 | 8 | namespace rc { 9 | using namespace nix; 10 | 11 | template<> 12 | struct Arbitrary { 13 | static Gen arbitrary(); 14 | }; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/libutil-test-support/include/nix/util/tests/meson.build: -------------------------------------------------------------------------------- 1 | # Public headers directory 2 | 3 | include_dirs = [include_directories('../../..')] 4 | 5 | headers = files( 6 | 'characterization.hh', 7 | 'gtest-with-params.hh', 8 | 'hash.hh', 9 | 'nix_api_util.hh', 10 | 'string_callback.hh', 11 | ) 12 | -------------------------------------------------------------------------------- /src/libutil-test-support/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libutil-test-support/string_callback.cc: -------------------------------------------------------------------------------- 1 | #include "nix/util/tests/string_callback.hh" 2 | 3 | namespace nix::testing { 4 | 5 | void observe_string_cb(const char * start, unsigned int n, void * user_data) 6 | { 7 | auto user_data_casted = reinterpret_cast(user_data); 8 | *user_data_casted = std::string(start); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/libutil-tests/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libutil-tests/data/git/hello-world-blob.bin: -------------------------------------------------------------------------------- 1 | blob 16Hello 2 | 3 | World -------------------------------------------------------------------------------- /src/libutil-tests/data/git/hello-world.bin: -------------------------------------------------------------------------------- 1 | Hello 2 | 3 | World -------------------------------------------------------------------------------- /src/libutil-tests/data/git/tree.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/src/libutil-tests/data/git/tree.bin -------------------------------------------------------------------------------- /src/libutil-tests/data/git/tree.txt: -------------------------------------------------------------------------------- 1 | 100644 blob 63ddb340119baf8492d2da53af47e8c7cfcd5eb2 Foo 2 | 100755 blob 63ddb340119baf8492d2da53af47e8c7cfcd5eb2 bAr 3 | 040000 tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904 baZ 4 | 120000 blob 63ddb340119baf8492d2da53af47e8c7cfcd5eb2 quuX 5 | -------------------------------------------------------------------------------- /src/libutil-tests/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libutil/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/libutil/exit.cc: -------------------------------------------------------------------------------- 1 | #include "nix/util/exit.hh" 2 | 3 | namespace nix { 4 | 5 | Exit::~Exit() {} 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/libutil/freebsd/include/nix/util/meson.build: -------------------------------------------------------------------------------- 1 | # Public headers directory 2 | 3 | include_dirs += include_directories('../..') 4 | 5 | headers += files( 6 | 'freebsd-jail.hh', 7 | ) 8 | -------------------------------------------------------------------------------- /src/libutil/freebsd/meson.build: -------------------------------------------------------------------------------- 1 | sources += files( 2 | 'freebsd-jail.cc', 3 | ) 4 | 5 | subdir('include/nix/util') 6 | -------------------------------------------------------------------------------- /src/libutil/include/nix/util/compute-levels.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | ///@file 3 | 4 | #include "nix/util/types.hh" 5 | 6 | namespace nix { 7 | 8 | StringSet computeLevels(); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/libutil/include/nix/util/repair-flag.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | ///@file 3 | 4 | namespace nix { 5 | 6 | enum RepairFlag : bool { NoRepair = false, Repair = true }; 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/libutil/linux/include/nix/util/meson.build: -------------------------------------------------------------------------------- 1 | # Public headers directory 2 | 3 | include_dirs += include_directories('../..') 4 | 5 | headers += files( 6 | 'cgroup.hh', 7 | 'linux-namespaces.hh', 8 | ) 9 | -------------------------------------------------------------------------------- /src/libutil/linux/meson.build: -------------------------------------------------------------------------------- 1 | sources += files( 2 | 'cgroup.cc', 3 | 'linux-namespaces.cc', 4 | ) 5 | 6 | subdir('include/nix/util') 7 | -------------------------------------------------------------------------------- /src/libutil/meson.options: -------------------------------------------------------------------------------- 1 | # vim: filetype=meson 2 | 3 | option('cpuid', type : 'feature', 4 | description : 'determine microarchitecture levels with libcpuid (only relevant on x86_64)', 5 | ) 6 | -------------------------------------------------------------------------------- /src/libutil/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/libutil/unix/include/nix/util/meson.build: -------------------------------------------------------------------------------- 1 | # Public headers directory 2 | 3 | include_dirs += include_directories('../..') 4 | 5 | headers += files( 6 | 'monitor-fd.hh', 7 | 'signals-impl.hh', 8 | ) 9 | -------------------------------------------------------------------------------- /src/libutil/windows/include/nix/util/meson.build: -------------------------------------------------------------------------------- 1 | # Public headers directory 2 | 3 | include_dirs += include_directories('../..') 4 | 5 | headers += files( 6 | 'signals-impl.hh', 7 | 'windows-async-pipe.hh', 8 | 'windows-error.hh', 9 | ) 10 | -------------------------------------------------------------------------------- /src/libutil/windows/meson.build: -------------------------------------------------------------------------------- 1 | sources += files( 2 | 'environment-variables.cc', 3 | 'file-descriptor.cc', 4 | 'file-path.cc', 5 | 'file-system.cc', 6 | 'muxable-pipe.cc', 7 | 'os-string.cc', 8 | 'processes.cc', 9 | 'users.cc', 10 | 'windows-async-pipe.cc', 11 | 'windows-error.cc', 12 | ) 13 | 14 | subdir('include/nix/util') 15 | -------------------------------------------------------------------------------- /src/nix-channel/unpack-channel.nix: -------------------------------------------------------------------------------- 1 | { 2 | name, 3 | channelName, 4 | src, 5 | }: 6 | 7 | derivation { 8 | builder = "builtin:unpack-channel"; 9 | 10 | system = "builtin"; 11 | 12 | inherit name channelName src; 13 | 14 | # No point in doing this remotely. 15 | preferLocalBuild = true; 16 | } 17 | -------------------------------------------------------------------------------- /src/nix-env/user-env.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | ///@file 3 | 4 | #include "nix/expr/get-drvs.hh" 5 | 6 | namespace nix { 7 | 8 | PackageInfos queryInstalled(EvalState & state, const Path & userEnv); 9 | 10 | bool createUserEnv(EvalState & state, PackageInfos & elems, 11 | const Path & profile, bool keepDerivations, 12 | const std::string & lockToken); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/nix-functional-tests: -------------------------------------------------------------------------------- 1 | ../tests/functional -------------------------------------------------------------------------------- /src/nix-manual: -------------------------------------------------------------------------------- 1 | ../doc/manual/ -------------------------------------------------------------------------------- /src/nix-store/dotgraph.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | ///@file 3 | 4 | #include "nix/store/store-api.hh" 5 | 6 | namespace nix { 7 | 8 | void printDotGraph(ref store, StorePathSet && roots); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/nix-store/graphml.hh: -------------------------------------------------------------------------------- 1 | #pragma once 2 | ///@file 3 | 4 | #include "nix/store/store-api.hh" 5 | 6 | namespace nix { 7 | 8 | void printGraphML(ref store, StorePathSet && roots); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/nix/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/nix/build-remote: -------------------------------------------------------------------------------- 1 | ../build-remote -------------------------------------------------------------------------------- /src/nix/doc: -------------------------------------------------------------------------------- 1 | ../../doc -------------------------------------------------------------------------------- /src/nix/help-stores.md: -------------------------------------------------------------------------------- 1 | ../../doc/manual/source/store/types/index.md.in -------------------------------------------------------------------------------- /src/nix/help.md: -------------------------------------------------------------------------------- 1 | R""( 2 | 3 | # Examples 4 | 5 | * Show help about `nix` in general: 6 | 7 | ```console 8 | # nix help 9 | ``` 10 | 11 | * Show help about a particular subcommand: 12 | 13 | ```console 14 | # nix help flake info 15 | ``` 16 | 17 | )"" 18 | -------------------------------------------------------------------------------- /src/nix/meson.options: -------------------------------------------------------------------------------- 1 | # vim: filetype=meson 2 | 3 | # A relative path means it gets appended to prefix. 4 | option('profile-dir', type : 'string', value : 'etc/profile.d', 5 | description : 'the path to install shell profile files', 6 | ) 7 | -------------------------------------------------------------------------------- /src/nix/misc: -------------------------------------------------------------------------------- 1 | ../../misc -------------------------------------------------------------------------------- /src/nix/nix-build: -------------------------------------------------------------------------------- 1 | ../nix-build -------------------------------------------------------------------------------- /src/nix/nix-channel: -------------------------------------------------------------------------------- 1 | ../nix-channel -------------------------------------------------------------------------------- /src/nix/nix-collect-garbage: -------------------------------------------------------------------------------- 1 | ../nix-collect-garbage -------------------------------------------------------------------------------- /src/nix/nix-copy-closure: -------------------------------------------------------------------------------- 1 | ../nix-copy-closure -------------------------------------------------------------------------------- /src/nix/nix-env: -------------------------------------------------------------------------------- 1 | ../nix-env -------------------------------------------------------------------------------- /src/nix/nix-instantiate: -------------------------------------------------------------------------------- 1 | ../nix-instantiate -------------------------------------------------------------------------------- /src/nix/nix-meson-build-support: -------------------------------------------------------------------------------- 1 | ../../nix-meson-build-support -------------------------------------------------------------------------------- /src/nix/nix-store: -------------------------------------------------------------------------------- 1 | ../nix-store/ -------------------------------------------------------------------------------- /src/nix/profiles.md: -------------------------------------------------------------------------------- 1 | ../../doc/manual/source/command-ref/files/profiles.md -------------------------------------------------------------------------------- /src/nix/scripts: -------------------------------------------------------------------------------- 1 | ../../scripts -------------------------------------------------------------------------------- /src/nix/store-gc.md: -------------------------------------------------------------------------------- 1 | R""( 2 | 3 | # Examples 4 | 5 | * Delete unreachable paths in the Nix store: 6 | 7 | ```console 8 | # nix store gc 9 | ``` 10 | 11 | * Delete up to 1 gigabyte of garbage: 12 | 13 | ```console 14 | # nix store gc --max 1G 15 | ``` 16 | 17 | # Description 18 | 19 | This command deletes unreachable paths in the Nix store. 20 | 21 | )"" 22 | -------------------------------------------------------------------------------- /src/perl/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /src/perl/.yath.rc.in: -------------------------------------------------------------------------------- 1 | [test] 2 | -I=rel(@lib_dir@) 3 | -------------------------------------------------------------------------------- /src/perl/MANIFEST: -------------------------------------------------------------------------------- 1 | Changes 2 | Makefile.PL 3 | MANIFEST 4 | Nix.xs 5 | README 6 | t/Nix.t 7 | lib/Nix.pm 8 | -------------------------------------------------------------------------------- /src/perl/t/init.t: -------------------------------------------------------------------------------- 1 | use strict; 2 | use warnings; 3 | use Test2::V0; 4 | 5 | use Nix::Store; 6 | 7 | my $s = new Nix::Store("dummy://"); 8 | 9 | my $res = $s->isValidPath("/nix/store/g1w7hy3qg1w7hy3qg1w7hy3qg1w7hy3q-bar"); 10 | 11 | ok(!$res, "should not have path"); 12 | 13 | done_testing; 14 | -------------------------------------------------------------------------------- /src/perl/t/meson.build: -------------------------------------------------------------------------------- 1 | # Nix-Perl Tests 2 | #============================================================================ 3 | 4 | 5 | # src 6 | #--------------------------------------------------- 7 | 8 | nix_perl_tests = files( 9 | 'init.t', 10 | ) 11 | 12 | 13 | foreach f : nix_perl_tests 14 | fs.copyfile(f) 15 | endforeach 16 | -------------------------------------------------------------------------------- /tests/functional/.version: -------------------------------------------------------------------------------- 1 | ../../.version -------------------------------------------------------------------------------- /tests/functional/build-hook-ca-floating.nix: -------------------------------------------------------------------------------- 1 | { busybox }: 2 | 3 | import ./build-hook.nix { 4 | inherit busybox; 5 | contentAddressed = true; 6 | } 7 | -------------------------------------------------------------------------------- /tests/functional/build-remote-content-addressed-fixed.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | file=build-hook-ca-fixed.nix 6 | 7 | source build-remote.sh 8 | -------------------------------------------------------------------------------- /tests/functional/build-remote-content-addressed-floating.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | file=build-hook-ca-floating.nix 6 | 7 | enableFeatures "ca-derivations" 8 | 9 | NIX_TESTS_CA_BY_DEFAULT=true 10 | 11 | source build-remote.sh 12 | -------------------------------------------------------------------------------- /tests/functional/build-remote-trustless-after.sh: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | # Variables must be defined by caller, so 4 | # shellcheck disable=SC2154 5 | 6 | outPath=$(readlink -f "$TEST_ROOT/result") 7 | grep 'FOO BAR BAZ' "${remoteDir}/${outPath}" 8 | -------------------------------------------------------------------------------- /tests/functional/build-remote-trustless-should-pass-0.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | # Remote trusts us 6 | file=build-hook.nix 7 | prog=nix-store 8 | proto=ssh 9 | 10 | source build-remote-trustless.sh 11 | source build-remote-trustless-after.sh 12 | -------------------------------------------------------------------------------- /tests/functional/build-remote-trustless-should-pass-1.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | # Remote trusts us 6 | file=build-hook.nix 7 | prog=nix-daemon 8 | proto=ssh-ng 9 | 10 | source build-remote-trustless.sh 11 | source build-remote-trustless-after.sh 12 | -------------------------------------------------------------------------------- /tests/functional/ca-shell.nix: -------------------------------------------------------------------------------- 1 | { 2 | inNixShell ? false, 3 | ... 4 | }@args: 5 | import ./shell.nix (args // { contentAddressed = true; }) 6 | -------------------------------------------------------------------------------- /tests/functional/ca/build-dry.sh: -------------------------------------------------------------------------------- 1 | source common.sh 2 | 3 | export NIX_TESTS_CA_BY_DEFAULT=1 4 | 5 | cd .. && source build-dry.sh 6 | 7 | -------------------------------------------------------------------------------- /tests/functional/ca/common.sh: -------------------------------------------------------------------------------- 1 | source ../common.sh 2 | 3 | enableFeatures "ca-derivations" 4 | 5 | TODO_NixOS 6 | 7 | restartDaemon 8 | -------------------------------------------------------------------------------- /tests/functional/ca/config.nix: -------------------------------------------------------------------------------- 1 | # Shim to get generated file 2 | import "${builtins.getEnv "_NIX_TEST_BUILD_DIR"}/ca/config.nix" 3 | -------------------------------------------------------------------------------- /tests/functional/ca/config.nix.in: -------------------------------------------------------------------------------- 1 | ../config.nix.in -------------------------------------------------------------------------------- /tests/functional/ca/derivation-advanced-attributes.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export NIX_TESTS_CA_BY_DEFAULT=1 4 | 5 | cd .. 6 | source derivation-advanced-attributes.sh 7 | -------------------------------------------------------------------------------- /tests/functional/ca/eval-store.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Ensure that garbage collection works properly with ca derivations 4 | 5 | source common.sh 6 | 7 | export NIX_TESTS_CA_BY_DEFAULT=1 8 | 9 | cd .. 10 | source eval-store.sh 11 | -------------------------------------------------------------------------------- /tests/functional/ca/flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | outputs = { self }: import ./content-addressed.nix { }; 3 | } 4 | -------------------------------------------------------------------------------- /tests/functional/ca/gc.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Ensure that garbage collection works properly with ca derivations 4 | 5 | source common.sh 6 | 7 | export NIX_TESTS_CA_BY_DEFAULT=1 8 | 9 | cd .. 10 | source gc.sh 11 | -------------------------------------------------------------------------------- /tests/functional/ca/import-from-derivation.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | export NIX_TESTS_CA_BY_DEFAULT=1 6 | 7 | cd .. && source import-from-derivation.sh 8 | 9 | -------------------------------------------------------------------------------- /tests/functional/ca/new-build-cmd.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | export NIX_TESTS_CA_BY_DEFAULT=1 6 | cd .. 7 | source ./build.sh 8 | -------------------------------------------------------------------------------- /tests/functional/ca/nix-run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | flakeDir="$TEST_HOME/flake" 6 | mkdir -p "${flakeDir}" 7 | cp flake.nix "${_NIX_TEST_BUILD_DIR}/ca/config.nix" content-addressed.nix "${flakeDir}" 8 | 9 | nix run --no-write-lock-file "path:${flakeDir}#runnable" 10 | -------------------------------------------------------------------------------- /tests/functional/ca/nix-shell.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | NIX_TESTS_CA_BY_DEFAULT=true 6 | cd .. 7 | source ./nix-shell.sh 8 | -------------------------------------------------------------------------------- /tests/functional/ca/post-hook.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | requireDaemonNewerThan "2.4pre20210626" 6 | 7 | export NIX_TESTS_CA_BY_DEFAULT=1 8 | cd .. 9 | source ./post-hook.sh 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/functional/ca/racy.nix: -------------------------------------------------------------------------------- 1 | # A derivation that would certainly fail if several builders tried to 2 | # build it at once. 3 | 4 | with import ./config.nix; 5 | 6 | mkDerivation { 7 | name = "simple"; 8 | buildCommand = '' 9 | mkdir $out 10 | echo bar >> $out/foo 11 | sleep 3 12 | [[ "$(cat $out/foo)" == bar ]] 13 | ''; 14 | } 15 | -------------------------------------------------------------------------------- /tests/functional/ca/recursive.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | requireDaemonNewerThan "2.4pre20210623" 6 | 7 | export NIX_TESTS_CA_BY_DEFAULT=1 8 | cd .. 9 | source ./recursive.sh 10 | -------------------------------------------------------------------------------- /tests/functional/ca/repl.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | export NIX_TESTS_CA_BY_DEFAULT=1 6 | 7 | cd .. && source repl.sh 8 | -------------------------------------------------------------------------------- /tests/functional/ca/selfref-gc.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | requireDaemonNewerThan "2.4pre20210626" 6 | 7 | enableFeatures "ca-derivations nix-command flakes" 8 | 9 | export NIX_TESTS_CA_BY_DEFAULT=1 10 | cd .. 11 | source ./selfref-gc.sh 12 | -------------------------------------------------------------------------------- /tests/functional/ca/why-depends.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | export NIX_TESTS_CA_BY_DEFAULT=1 6 | 7 | cd .. && source why-depends.sh 8 | -------------------------------------------------------------------------------- /tests/functional/characterisation/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/tests/functional/characterisation/empty -------------------------------------------------------------------------------- /tests/functional/common/meson.build: -------------------------------------------------------------------------------- 1 | configure_file( 2 | input : 'subst-vars.sh.in', 3 | output : 'subst-vars.sh', 4 | configuration : test_confdata, 5 | ) 6 | -------------------------------------------------------------------------------- /tests/functional/common/test-root.sh: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | TEST_ROOT=$(realpath "${TMPDIR:-/tmp}/nix-test")/${TEST_NAME:-default/tests\/functional//} 4 | export TEST_ROOT 5 | -------------------------------------------------------------------------------- /tests/functional/compute-levels.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | if [[ $(uname -ms) = "Linux x86_64" ]]; then 6 | # x86_64 CPUs must always support the baseline 7 | # microarchitecture level. 8 | nix -vv --version | grepQuiet "x86_64-v1-linux" 9 | fi 10 | -------------------------------------------------------------------------------- /tests/functional/config.nix: -------------------------------------------------------------------------------- 1 | # Shim to get generated file 2 | import "${builtins.getEnv "_NIX_TEST_BUILD_DIR"}/config.nix" 3 | -------------------------------------------------------------------------------- /tests/functional/config/extra-config.conf: -------------------------------------------------------------------------------- 1 | allowed-uris = https://github.com/NixOS/nix -------------------------------------------------------------------------------- /tests/functional/config/nix-with-bang-include.conf: -------------------------------------------------------------------------------- 1 | experimental-features = nix-command 2 | !include ./missing-extra-config.conf -------------------------------------------------------------------------------- /tests/functional/config/nix-with-include.conf: -------------------------------------------------------------------------------- 1 | experimental-features = nix-command 2 | include ./extra-config.conf -------------------------------------------------------------------------------- /tests/functional/config/nix-with-substituters.conf: -------------------------------------------------------------------------------- 1 | experimental-features = nix-command 2 | substituters = https://example.com 3 | -------------------------------------------------------------------------------- /tests/functional/derivation/ca/advanced-attributes-defaults.drv: -------------------------------------------------------------------------------- 1 | Derive([("out","","r:sha256","")],[],[],"my-system","/bin/bash",["-c","echo hello > $out"],[("builder","/bin/bash"),("name","advanced-attributes-defaults"),("out","/1rz4g4znpzjwh1xymhjpm42vipw92pr73vdgl6xs1hycac8kf2n9"),("outputHashAlgo","sha256"),("outputHashMode","recursive"),("system","my-system")]) -------------------------------------------------------------------------------- /tests/functional/dot.nar: -------------------------------------------------------------------------------- 1 | nix-archive-1(type directoryentry(name.node(typeregularcontentshello 2 | ))) -------------------------------------------------------------------------------- /tests/functional/dotdot.nar: -------------------------------------------------------------------------------- 1 | nix-archive-1(type directoryentry(name..node(typeregularcontentshello 2 | ))) -------------------------------------------------------------------------------- /tests/functional/dummy: -------------------------------------------------------------------------------- 1 | Hello World 2 | -------------------------------------------------------------------------------- /tests/functional/dyn-drv/common.sh: -------------------------------------------------------------------------------- 1 | source ../common.sh 2 | 3 | # Need backend to support text-hashing too 4 | requireDaemonNewerThan "2.16.0pre20230419" 5 | 6 | enableFeatures "ca-derivations dynamic-derivations" 7 | 8 | TODO_NixOS 9 | 10 | restartDaemon 11 | -------------------------------------------------------------------------------- /tests/functional/dyn-drv/config.nix: -------------------------------------------------------------------------------- 1 | # Shim to get generated file 2 | import "${builtins.getEnv "_NIX_TEST_BUILD_DIR"}/dyn-drv/config.nix" 3 | -------------------------------------------------------------------------------- /tests/functional/dyn-drv/config.nix.in: -------------------------------------------------------------------------------- 1 | ../config.nix.in -------------------------------------------------------------------------------- /tests/functional/dyn-drv/dep-built-drv.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | out1=$(nix-build ./text-hashed-output.nix -A hello --no-out-link) 6 | 7 | # Store layer needs bugfix 8 | requireDaemonNewerThan "2.30pre20250515" 9 | 10 | clearStore 11 | 12 | out2=$(nix-build ./text-hashed-output.nix -A wrapper --no-out-link) 13 | 14 | diff -r $out1 $out2 15 | -------------------------------------------------------------------------------- /tests/functional/empty.nar: -------------------------------------------------------------------------------- 1 | nix-archive-1(type directoryentry(namenode(typeregularcontentshello 2 | ))) -------------------------------------------------------------------------------- /tests/functional/eval.nix: -------------------------------------------------------------------------------- 1 | { 2 | int = 123; 3 | str = "foo\nbar"; 4 | attr.foo = "bar"; 5 | } 6 | -------------------------------------------------------------------------------- /tests/functional/executable-after-contents.nar: -------------------------------------------------------------------------------- 1 | nix-archive-1(type directoryentry(namefoonode(typeregularcontentshello 2 | 3 | executable))) -------------------------------------------------------------------------------- /tests/functional/fixed.builder1.sh: -------------------------------------------------------------------------------- 1 | if test "$IMPURE_VAR1" != "foo"; then exit 1; fi 2 | if test "$IMPURE_VAR2" != "bar"; then exit 1; fi 3 | echo "Hello World!" > $out 4 | -------------------------------------------------------------------------------- /tests/functional/fixed.builder2.sh: -------------------------------------------------------------------------------- 1 | echo dummy: $dummy 2 | if test -n "$dummy"; then sleep 2; fi 3 | mkdir $out 4 | mkdir $out/bla 5 | echo "Hello World!" > $out/foo 6 | ln -s foo $out/bar 7 | -------------------------------------------------------------------------------- /tests/functional/flakes/edit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source ./common.sh 4 | 5 | createFlake1 6 | 7 | export EDITOR=cat 8 | nix edit "$flake1Dir#" | grepQuiet simple.builder.sh 9 | -------------------------------------------------------------------------------- /tests/functional/flakes/prefetch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | # Test symlinks in zip files (#10649). 6 | path=$(nix flake prefetch --json file://$(pwd)/tree.zip | jq -r .storePath) 7 | [[ $(cat $path/foo) = foo ]] 8 | [[ $(readlink $path/bar) = foo ]] 9 | -------------------------------------------------------------------------------- /tests/functional/flakes/tree.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/tests/functional/flakes/tree.zip -------------------------------------------------------------------------------- /tests/functional/formatter.simple.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | echo "PRJ_ROOT=$PRJ_ROOT Formatting(${#}):" "${@}" 3 | -------------------------------------------------------------------------------- /tests/functional/gc-concurrent2.builder.sh: -------------------------------------------------------------------------------- 1 | mkdir $out 2 | echo $(cat $input1/foo)$(cat $input2/bar)xyzzy > $out/foobar 3 | 4 | # Check that the GC hasn't deleted the lock on our output. 5 | test -e "$out.lock" 6 | -------------------------------------------------------------------------------- /tests/functional/git-hashing/common.sh: -------------------------------------------------------------------------------- 1 | source ../common.sh 2 | 3 | TODO_NixOS # Need to enable git hashing feature and make sure test is ok for store we don't clear 4 | 5 | clearStore 6 | clearCache 7 | 8 | # Need backend to support git-hashing too 9 | requireDaemonNewerThan "2.19" 10 | 11 | enableFeatures "git-hashing" 12 | 13 | restartDaemon 14 | -------------------------------------------------------------------------------- /tests/functional/git-hashing/fixed.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | # Store layer needs bugfix 6 | requireDaemonNewerThan "2.27pre20250122" 7 | 8 | nix-build ../fixed.nix -A git --no-out-link 9 | -------------------------------------------------------------------------------- /tests/functional/git-hashing/meson.build: -------------------------------------------------------------------------------- 1 | suites += { 2 | 'name': 'git-hashing', 3 | 'deps': [], 4 | 'tests': [ 5 | 'simple.sh', 6 | 'fixed.sh', 7 | ], 8 | 'workdir': meson.current_source_dir(), 9 | } 10 | -------------------------------------------------------------------------------- /tests/functional/ifd.nix: -------------------------------------------------------------------------------- 1 | with import ./config.nix; 2 | import (mkDerivation { 3 | name = "foo"; 4 | bla = import ./dependencies.nix { }; 5 | buildCommand = " 6 | echo \\\"hi\\\" > $out 7 | "; 8 | }) 9 | -------------------------------------------------------------------------------- /tests/functional/impure-env.nix: -------------------------------------------------------------------------------- 1 | { var, value }: 2 | 3 | with import ./config.nix; 4 | 5 | mkDerivation { 6 | name = "test"; 7 | buildCommand = '' 8 | echo ${var} = "''$${var}" 9 | echo -n "''$${var}" > "$out" 10 | ''; 11 | 12 | impureEnvVars = [ var ]; 13 | 14 | outputHashAlgo = "sha256"; 15 | outputHash = builtins.hashString "sha256" value; 16 | } 17 | -------------------------------------------------------------------------------- /tests/functional/lang/data: -------------------------------------------------------------------------------- 1 | foo 2 | -------------------------------------------------------------------------------- /tests/functional/lang/dir1/a.nix: -------------------------------------------------------------------------------- 1 | "a" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/dir2/a.nix: -------------------------------------------------------------------------------- 1 | "X" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/dir2/b.nix: -------------------------------------------------------------------------------- 1 | "b" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/dir3/a.nix: -------------------------------------------------------------------------------- 1 | "X" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/dir3/b.nix: -------------------------------------------------------------------------------- 1 | "X" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/dir3/c.nix: -------------------------------------------------------------------------------- 1 | "c" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/dir4/a.nix: -------------------------------------------------------------------------------- 1 | "X" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/dir4/c.nix: -------------------------------------------------------------------------------- 1 | "X" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-abort.err.exp: -------------------------------------------------------------------------------- 1 | error: 2 | … while calling the 'abort' builtin 3 | at /pwd/lang/eval-fail-abort.nix:1:14: 4 | 1| if true then abort "this should fail" else 1 5 | | ^ 6 | 2| 7 | 8 | error: evaluation aborted with the following error message: 'this should fail' 9 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-abort.nix: -------------------------------------------------------------------------------- 1 | if true then abort "this should fail" else 1 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-addDrvOutputDependencies-empty-context.nix: -------------------------------------------------------------------------------- 1 | builtins.addDrvOutputDependencies "" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-addDrvOutputDependencies-wrong-element-kind.nix: -------------------------------------------------------------------------------- 1 | let 2 | drv = derivation { 3 | name = "fail"; 4 | builder = "/bin/false"; 5 | system = "x86_64-linux"; 6 | outputs = [ 7 | "out" 8 | "foo" 9 | ]; 10 | }; 11 | 12 | in 13 | builtins.addDrvOutputDependencies drv.outPath 14 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-addErrorContext-example.flags: -------------------------------------------------------------------------------- 1 | --eval --strict --no-show-trace 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-addErrorContext-example.nix: -------------------------------------------------------------------------------- 1 | let 2 | countDown = 3 | n: 4 | if n == 0 then 5 | throw "kaboom" 6 | else 7 | builtins.addErrorContext "while counting down; n = ${toString n}" ("x" + countDown (n - 1)); 8 | in 9 | countDown 10 10 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-assert-equal-attrs-names-2.nix: -------------------------------------------------------------------------------- 1 | assert 2 | { 3 | a = true; 4 | } == { 5 | a = true; 6 | b = true; 7 | }; 8 | throw "unreachable" 9 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-assert-equal-attrs-names.nix: -------------------------------------------------------------------------------- 1 | assert 2 | { 3 | a = true; 4 | b = true; 5 | } == { 6 | a = true; 7 | }; 8 | throw "unreachable" 9 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-assert-equal-derivations-extra.nix: -------------------------------------------------------------------------------- 1 | assert 2 | { 3 | foo = { 4 | type = "derivation"; 5 | outPath = "/nix/store/0"; 6 | }; 7 | } == { 8 | foo = { 9 | type = "derivation"; 10 | outPath = "/nix/store/1"; 11 | devious = true; 12 | }; 13 | }; 14 | throw "unreachable" 15 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-assert-equal-floats.nix: -------------------------------------------------------------------------------- 1 | assert { b = 1.0; } == { b = 1.01; }; 2 | abort "unreachable" 3 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-assert-equal-function-direct.nix: -------------------------------------------------------------------------------- 1 | # Note: functions in nested structures, e.g. attributes, may be optimized away by pointer identity optimization. 2 | # This only compares a direct comparison and makes no claims about functions in nested structures. 3 | assert (x: x) == (x: x); 4 | abort "unreachable" 5 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-assert-equal-int-float.nix: -------------------------------------------------------------------------------- 1 | assert 1 == 1.1; 2 | throw "unreachable" 3 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-assert-equal-ints.nix: -------------------------------------------------------------------------------- 1 | assert { b = 1; } == { b = 2; }; 2 | abort "unreachable" 3 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-assert-equal-list-length.nix: -------------------------------------------------------------------------------- 1 | assert 2 | [ 3 | 1 4 | 0 5 | ] == [ 10 ]; 6 | throw "unreachable" 7 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-assert-equal-paths.nix: -------------------------------------------------------------------------------- 1 | assert ./foo == ./bar; 2 | throw "unreachable" 3 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-assert-equal-type-nested.nix: -------------------------------------------------------------------------------- 1 | assert { ding = false; } == { ding = null; }; 2 | abort "unreachable" 3 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-assert-equal-type.nix: -------------------------------------------------------------------------------- 1 | assert false == null; 2 | abort "unreachable" 3 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-assert-nested-bool.nix: -------------------------------------------------------------------------------- 1 | assert { a.b = [ { c.d = true; } ]; } == { a.b = [ { c.d = false; } ]; }; 2 | 3 | abort "unreachable" 4 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-assert.nix: -------------------------------------------------------------------------------- 1 | let { 2 | x = 3 | arg: 4 | assert arg == "y"; 5 | 123; 6 | 7 | body = x "x"; 8 | } 9 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-attr-name-type.nix: -------------------------------------------------------------------------------- 1 | let 2 | attrs = { 3 | puppy.doggy = { }; 4 | }; 5 | key = 1; 6 | in 7 | attrs.puppy.${key} 8 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-attrset-merge-drops-later-rec.err.exp: -------------------------------------------------------------------------------- 1 | error: undefined variable 'd' 2 | at /pwd/lang/eval-fail-attrset-merge-drops-later-rec.nix:4:9: 3 | 3| a = rec { 4 | 4| c = d + 2; 5 | | ^ 6 | 5| d = 3; 7 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-attrset-merge-drops-later-rec.nix: -------------------------------------------------------------------------------- 1 | { 2 | a.b = 1; 3 | a = rec { 4 | c = d + 2; 5 | d = 3; 6 | }; 7 | } 8 | .c 9 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-bad-string-interpolation-1.nix: -------------------------------------------------------------------------------- 1 | "${x: x}" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-bad-string-interpolation-2.err.exp: -------------------------------------------------------------------------------- 1 | error: path '/pwd/lang/fnord' does not exist 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-bad-string-interpolation-2.nix: -------------------------------------------------------------------------------- 1 | "${./fnord}" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-bad-string-interpolation-3.nix: -------------------------------------------------------------------------------- 1 | ''${x: x}'' 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-blackhole.nix: -------------------------------------------------------------------------------- 1 | let { 2 | body = x; 3 | x = y; 4 | y = x; 5 | } 6 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-call-primop.nix: -------------------------------------------------------------------------------- 1 | builtins.length 1 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-deepseq.nix: -------------------------------------------------------------------------------- 1 | builtins.deepSeq { x = abort "foo"; } 456 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-derivation-name.nix: -------------------------------------------------------------------------------- 1 | derivation { 2 | name = "~jiggle~"; 3 | system = "some-system"; 4 | builder = "/dontcare"; 5 | } 6 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-derivation-name.postprocess: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | set -euo pipefail 3 | testcaseBasename=$1 4 | 5 | # Line numbers change when derivation.nix docs are updated. 6 | sed -i "$testcaseBasename.err" \ 7 | -e 's/[0-9 ][0-9 ][0-9 ][0-9 ][0-9 ][0-9 ][0-9 ][0-9]\([^0-9]\)/\1/g' \ 8 | -e 's/[0-9][0-9]*//g' \ 9 | ; 10 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-dup-dynamic-attrs.nix: -------------------------------------------------------------------------------- 1 | { 2 | set = { 3 | "${"" + "b"}" = 1; 4 | }; 5 | set = { 6 | "${"b" + ""}" = 2; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-duplicate-traces.nix: -------------------------------------------------------------------------------- 1 | # Check that we only omit duplicate stack traces when there's a bunch of them. 2 | # Here, there's only a couple duplicate entries, so we output them all. 3 | let 4 | throwAfter = n: if n > 0 then throwAfter (n - 1) else throw "Uh oh!"; 5 | in 6 | throwAfter 2 7 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-eol-1.err.exp: -------------------------------------------------------------------------------- 1 | error: undefined variable 'invalid' 2 | at /pwd/lang/eval-fail-eol-1.nix:2:1: 3 | 1| # foo 4 | 2| invalid 5 | | ^ 6 | 3| # bar 7 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-eol-1.nix: -------------------------------------------------------------------------------- 1 | # foo 2 | invalid 3 | # bar 4 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-eol-2.err.exp: -------------------------------------------------------------------------------- 1 | error: undefined variable 'invalid' 2 | at /pwd/lang/eval-fail-eol-2.nix:2:1: 3 | 1| # foo 4 | 2| invalid 5 | | ^ 6 | 3| # bar 7 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-eol-2.nix: -------------------------------------------------------------------------------- 1 | # foo invalid 2 | # bar 3 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-eol-3.err.exp: -------------------------------------------------------------------------------- 1 | error: undefined variable 'invalid' 2 | at /pwd/lang/eval-fail-eol-3.nix:2:1: 3 | 1| # foo 4 | 2| invalid 5 | | ^ 6 | 3| # bar 7 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-eol-3.nix: -------------------------------------------------------------------------------- 1 | # foo 2 | invalid 3 | # bar 4 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-fetchTree-negative.err.exp: -------------------------------------------------------------------------------- 1 | error: 2 | … while calling the 'fetchTree' builtin 3 | at /pwd/lang/eval-fail-fetchTree-negative.nix:1:1: 4 | 1| builtins.fetchTree { 5 | | ^ 6 | 2| type = "file"; 7 | 8 | error: negative value given for 'fetchTree' argument 'owner': -1 9 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-fetchTree-negative.nix: -------------------------------------------------------------------------------- 1 | builtins.fetchTree { 2 | type = "file"; 3 | url = "file://eval-fail-fetchTree-negative.nix"; 4 | owner = -1; 5 | } 6 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-fetchurl-baseName-attrs-name.nix: -------------------------------------------------------------------------------- 1 | builtins.fetchurl { 2 | url = "https://example.com/foo.tar.gz"; 3 | name = "~wobble~"; 4 | } 5 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-fetchurl-baseName-attrs.nix: -------------------------------------------------------------------------------- 1 | builtins.fetchurl { url = "https://example.com/~wiggle~"; } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-fetchurl-baseName.nix: -------------------------------------------------------------------------------- 1 | builtins.fetchurl "https://example.com/~wiggle~" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-flake-ref-to-string-negative-integer.nix: -------------------------------------------------------------------------------- 1 | let 2 | n = -1; 3 | in 4 | builtins.seq n ( 5 | builtins.flakeRefToString { 6 | type = "github"; 7 | owner = "NixOS"; 8 | repo = n; 9 | ref = "23.05"; 10 | dir = "lib"; 11 | } 12 | ) 13 | -------------------------------------------------------------------------------- /tests/functional/lang/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' (_: f: f null) null [ 3 | (_: throw "Not the final value, but is still forced!") 4 | (_: 23) 5 | ] 6 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-fromJSON-keyWithNullByte.nix: -------------------------------------------------------------------------------- 1 | builtins.fromJSON ''{"a\u0000b": 1}'' 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-fromJSON-overflowing.nix: -------------------------------------------------------------------------------- 1 | builtins.fromJSON ''{"attr": 18446744073709551615}'' 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-fromJSON-valueWithNullByte.nix: -------------------------------------------------------------------------------- 1 | builtins.fromJSON ''"a\u0000b"'' 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-fromTOML-keyWithNullByte.nix: -------------------------------------------------------------------------------- 1 | builtins.fromTOML ''"a\u0000b" = 1'' 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-fromTOML-timestamps.err.exp: -------------------------------------------------------------------------------- 1 | error: 2 | … while calling the 'fromTOML' builtin 3 | at /pwd/lang/eval-fail-fromTOML-timestamps.nix:1:1: 4 | 1| builtins.fromTOML '' 5 | | ^ 6 | 2| key = "value" 7 | 8 | error: while parsing TOML: Dates and times are not supported 9 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-fromTOML-valueWithNullByte.nix: -------------------------------------------------------------------------------- 1 | builtins.fromTOML ''k = "a\u0000b"'' 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-infinite-recursion-lambda.flags: -------------------------------------------------------------------------------- 1 | --max-call-depth 100 -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-infinite-recursion-lambda.nix: -------------------------------------------------------------------------------- 1 | (x: x x) (x: x x) 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-list.err.exp: -------------------------------------------------------------------------------- 1 | error: 2 | … while evaluating one of the elements to concatenate 3 | at /pwd/lang/eval-fail-list.nix:1:3: 4 | 1| 8 ++ 1 5 | | ^ 6 | 2| 7 | 8 | error: expected a list but found an integer: 8 9 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-list.nix: -------------------------------------------------------------------------------- 1 | 8 ++ 1 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-missing-arg.nix: -------------------------------------------------------------------------------- 1 | ( 2 | { 3 | x, 4 | y, 5 | z, 6 | }: 7 | x + y + z 8 | ) 9 | { 10 | x = "foo"; 11 | z = "bar"; 12 | } 13 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-nested-list-items.err.exp: -------------------------------------------------------------------------------- 1 | error: 2 | … while evaluating a path segment 3 | at /pwd/lang/eval-fail-nested-list-items.nix:12:3: 4 | 11| "" 5 | 12| + ( 6 | | ^ 7 | 13| let 8 | 9 | error: cannot coerce a list to a string: [ [ 1 2 3 4 5 6 7 8 ] [ 1 «3 items elided» ] ] 10 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-nonexist-path.err.exp: -------------------------------------------------------------------------------- 1 | error: path '/pwd/lang/fnord' does not exist 2 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-not-throws.nix: -------------------------------------------------------------------------------- 1 | !(throw "uh oh!") 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-overflowing-add.err.exp: -------------------------------------------------------------------------------- 1 | error: integer overflow in adding 9223372036854775807 + 1 2 | at /pwd/lang/eval-fail-overflowing-add.nix:5:5: 3 | 4| in 4 | 5| a + b 5 | | ^ 6 | 6| 7 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-overflowing-add.nix: -------------------------------------------------------------------------------- 1 | let 2 | a = 9223372036854775807; 3 | b = 1; 4 | in 5 | a + b 6 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-overflowing-div.nix: -------------------------------------------------------------------------------- 1 | let 2 | # lol, this has to be written as an expression like this because negative 3 | # numbers use unary negation rather than parsing directly, and 2**63 is out 4 | # of range 5 | intMin = -9223372036854775807 - 1; 6 | b = -1; 7 | in 8 | builtins.seq intMin (builtins.seq b (intMin / b)) 9 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-overflowing-mul.nix: -------------------------------------------------------------------------------- 1 | let 2 | a = 4294967297; 3 | in 4 | a * a * a 5 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-overflowing-sub.err.exp: -------------------------------------------------------------------------------- 1 | error: 2 | … while calling the 'sub' builtin 3 | at /pwd/lang/eval-fail-overflowing-sub.nix:5:3: 4 | 4| in 5 | 5| a - b 6 | | ^ 7 | 6| 8 | 9 | error: integer overflow in subtracting -9223372036854775807 - 2 10 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-overflowing-sub.nix: -------------------------------------------------------------------------------- 1 | let 2 | a = -9223372036854775807; 3 | b = 2; 4 | in 5 | a - b 6 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-path-slash.err.exp: -------------------------------------------------------------------------------- 1 | error: path has a trailing slash 2 | at /pwd/lang/eval-fail-path-slash.nix:6:12: 3 | 5| # and https://nixos.org/nix-dev/2016-June/020829.html 4 | 6| /nix/store/ 5 | | ^ 6 | 7| 7 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-pipe-operators.err.exp: -------------------------------------------------------------------------------- 1 | error: experimental Nix feature 'pipe-operators' is disabled; add '--extra-experimental-features pipe-operators' to enable it 2 | at /pwd/lang/eval-fail-pipe-operators.nix:1:3: 3 | 1| 1 |> 2 4 | | ^ 5 | 2| 6 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-pipe-operators.nix: -------------------------------------------------------------------------------- 1 | 1 |> 2 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-recursion.nix: -------------------------------------------------------------------------------- 1 | let 2 | a = { } // a; 3 | in 4 | a.foo 5 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-remove.nix: -------------------------------------------------------------------------------- 1 | let { 2 | attrs = { 3 | x = 123; 4 | y = 456; 5 | }; 6 | 7 | body = (removeAttrs attrs [ "x" ]).x; 8 | } 9 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-scope-5.nix: -------------------------------------------------------------------------------- 1 | let { 2 | 3 | x = "a"; 4 | y = "b"; 5 | 6 | f = 7 | { 8 | x ? y, 9 | y ? x, 10 | }: 11 | x + y; 12 | 13 | body = f { }; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-seq.nix: -------------------------------------------------------------------------------- 1 | builtins.seq (abort "foo") 2 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-set-override.err.exp: -------------------------------------------------------------------------------- 1 | error: 2 | … while evaluating the `__overrides` attribute 3 | 4 | error: expected a set but found an integer: 1 5 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-set-override.nix: -------------------------------------------------------------------------------- 1 | rec { __overrides = 1; } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-set.err.exp: -------------------------------------------------------------------------------- 1 | error: undefined variable 'x' 2 | at /pwd/lang/eval-fail-set.nix:1:3: 3 | 1| 8.x 4 | | ^ 5 | 2| 6 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-set.nix: -------------------------------------------------------------------------------- 1 | 8.x 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-string-nul-1.err.exp: -------------------------------------------------------------------------------- 1 | error: input string 'foo␀bar' cannot be represented as Nix string because it contains null bytes 2 | at /pwd/lang/eval-fail-string-nul-1.nix:1:2: 3 | 1| "foobar" 4 | | ^ 5 | 2| 6 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-string-nul-1.nix: -------------------------------------------------------------------------------- 1 | "foobar" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-string-nul-2.err.exp: -------------------------------------------------------------------------------- 1 | error: input string ' foo 2 | ␀ 3 | bar 4 | ' cannot be represented as Nix string because it contains null bytes 5 | at /pwd/lang/eval-fail-string-nul-2.nix:2:1: 6 | 1| '' 7 | 2| foo 8 | | ^ 9 | 3| 10 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-string-nul-2.nix: -------------------------------------------------------------------------------- 1 | '' 2 | foo 3 | 4 | bar 5 | '' 6 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-substring.err.exp: -------------------------------------------------------------------------------- 1 | error: 2 | … while calling the 'substring' builtin 3 | at /pwd/lang/eval-fail-substring.nix:1:1: 4 | 1| builtins.substring (builtins.sub 0 1) 1 "x" 5 | | ^ 6 | 2| 7 | 8 | error: negative start position in 'substring' 9 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-substring.nix: -------------------------------------------------------------------------------- 1 | builtins.substring (builtins.sub 0 1) 1 "x" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-to-path.nix: -------------------------------------------------------------------------------- 1 | builtins.toPath "foo/bar" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-toJSON-non-utf-8.err.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/tests/functional/lang/eval-fail-toJSON-non-utf-8.err.exp -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-toJSON-non-utf-8.nix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/tests/functional/lang/eval-fail-toJSON-non-utf-8.nix -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-toJSON.nix: -------------------------------------------------------------------------------- 1 | builtins.toJSON { 2 | a.b = [ 3 | true 4 | false 5 | "it's a bird" 6 | { 7 | c.d = throw "hah no"; 8 | } 9 | ]; 10 | } 11 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-undeclared-arg.nix: -------------------------------------------------------------------------------- 1 | ({ x, z }: x + z) { 2 | x = "foo"; 3 | y = "bla"; 4 | z = "bar"; 5 | } 6 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-fail-using-set-as-attr-name.nix: -------------------------------------------------------------------------------- 1 | let 2 | attr = { 3 | foo = "bar"; 4 | }; 5 | key = { }; 6 | in 7 | attr.${key} 8 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-any-all.exp: -------------------------------------------------------------------------------- 1 | [ false false true true true true false true ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-arithmetic.exp: -------------------------------------------------------------------------------- 1 | 2216 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-attrnames.exp: -------------------------------------------------------------------------------- 1 | "newxfoonewxy" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-attrs.exp: -------------------------------------------------------------------------------- 1 | 987 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-attrs.nix: -------------------------------------------------------------------------------- 1 | let { 2 | as = 3 | { 4 | x = 123; 5 | y = 456; 6 | } 7 | // { 8 | z = 789; 9 | } 10 | // { 11 | z = 987; 12 | }; 13 | 14 | body = 15 | if as ? a then 16 | as.a 17 | else 18 | assert as ? z; 19 | as.z; 20 | } 21 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-attrs2.exp: -------------------------------------------------------------------------------- 1 | 987 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-attrs3.exp: -------------------------------------------------------------------------------- 1 | "foo 22 80 itchyxac" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-attrs4.exp: -------------------------------------------------------------------------------- 1 | [ true false true false false true false false ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-attrs4.nix: -------------------------------------------------------------------------------- 1 | let 2 | 3 | as = { 4 | x.y.z = 123; 5 | a.b.c = 456; 6 | }; 7 | 8 | bs = null; 9 | 10 | in 11 | [ 12 | (as ? x) 13 | (as ? y) 14 | (as ? x.y.z) 15 | (as ? x.y.z.a) 16 | (as ? x.y.a) 17 | (as ? a.b.c) 18 | (bs ? x) 19 | (bs ? x.y.z) 20 | ] 21 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-attrs5.exp: -------------------------------------------------------------------------------- 1 | [ 123 "foo" 456 456 "foo" "xyzzy" "xyzzy" true ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-attrs6.exp: -------------------------------------------------------------------------------- 1 | { __overrides = { bar = "qux"; }; bar = "qux"; foo = "bar"; } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-attrs6.nix: -------------------------------------------------------------------------------- 1 | rec { 2 | "${"foo"}" = "bar"; 3 | __overrides = { 4 | bar = "qux"; 5 | }; 6 | } 7 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-autoargs.exp: -------------------------------------------------------------------------------- 1 | "xyzzy!xyzzy!foobar" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-autoargs.flags: -------------------------------------------------------------------------------- 1 | --arg lib import(lang/lib.nix) --argstr xyzzy xyzzy! -A result 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-autoargs.nix: -------------------------------------------------------------------------------- 1 | let 2 | 3 | foobar = "foobar"; 4 | 5 | in 6 | 7 | { 8 | xyzzy2 ? xyzzy, # mutually recursive args 9 | xyzzy ? "blaat", # will be overridden by --argstr 10 | fb ? foobar, 11 | lib, # will be set by --arg 12 | }: 13 | 14 | { 15 | result = lib.concat [ 16 | xyzzy 17 | xyzzy2 18 | fb 19 | ]; 20 | } 21 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-backslash-newline-1.exp: -------------------------------------------------------------------------------- 1 | "a\nb" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-backslash-newline-1.nix: -------------------------------------------------------------------------------- 1 | "a\ 2 | b" 3 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-backslash-newline-2.exp: -------------------------------------------------------------------------------- 1 | "a\nb" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-backslash-newline-2.nix: -------------------------------------------------------------------------------- 1 | ''a''\ 2 | b'' 3 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-baseNameOf.exp: -------------------------------------------------------------------------------- 1 | "ok" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-builtins-add.exp: -------------------------------------------------------------------------------- 1 | [ 5 4 "int" "tt" "float" 4 ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-builtins.exp: -------------------------------------------------------------------------------- 1 | /foo 2 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-callable-attrs.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-callable-attrs.nix: -------------------------------------------------------------------------------- 1 | ( 2 | { 3 | __functor = self: x: self.foo && x; 4 | foo = false; 5 | } 6 | // { 7 | foo = true; 8 | } 9 | ) 10 | true 11 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-catattrs.exp: -------------------------------------------------------------------------------- 1 | [ 1 2 ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-catattrs.nix: -------------------------------------------------------------------------------- 1 | builtins.catAttrs "a" [ 2 | { a = 1; } 3 | { b = 0; } 4 | { a = 2; } 5 | ] 6 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-comments.exp: -------------------------------------------------------------------------------- 1 | "abcdefghijklmnopqrstuvwxyz" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-concat.exp: -------------------------------------------------------------------------------- 1 | [ 1 2 3 4 5 6 7 8 9 ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-concat.nix: -------------------------------------------------------------------------------- 1 | [ 2 | 1 3 | 2 4 | 3 5 | ] 6 | ++ [ 7 | 4 8 | 5 9 | 6 10 | ] 11 | ++ [ 12 | 7 13 | 8 14 | 9 15 | ] 16 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-concatmap.exp: -------------------------------------------------------------------------------- 1 | [ [ 1 3 5 7 9 ] [ "a" "z" "b" "z" ] ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-concatmap.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | [ 4 | (builtins.concatMap (x: if x / 2 * 2 == x then [ ] else [ x ]) (range 0 10)) 5 | (builtins.concatMap (x: [ x ] ++ [ "z" ]) [ 6 | "a" 7 | "b" 8 | ]) 9 | ] 10 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-concatstringssep.exp: -------------------------------------------------------------------------------- 1 | [ "" "foobarxyzzy" "foo, bar, xyzzy" "foo" "" ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-concatstringssep.nix: -------------------------------------------------------------------------------- 1 | with builtins; 2 | 3 | [ 4 | (concatStringsSep "" [ ]) 5 | (concatStringsSep "" [ 6 | "foo" 7 | "bar" 8 | "xyzzy" 9 | ]) 10 | (concatStringsSep ", " [ 11 | "foo" 12 | "bar" 13 | "xyzzy" 14 | ]) 15 | (concatStringsSep ", " [ "foo" ]) 16 | (concatStringsSep ", " [ ]) 17 | ] 18 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-context-introspection.exp: -------------------------------------------------------------------------------- 1 | [ true true true true true true true true true true true true true ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-context.exp: -------------------------------------------------------------------------------- 1 | "foo eval-okay-context.nix bar" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-context.nix: -------------------------------------------------------------------------------- 1 | let 2 | s = "foo ${builtins.substring 33 100 (baseNameOf "${./eval-okay-context.nix}")} bar"; 3 | in 4 | if s != "foo eval-okay-context.nix bar" then 5 | abort "context not discarded" 6 | else 7 | builtins.unsafeDiscardStringContext s 8 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-curpos.exp: -------------------------------------------------------------------------------- 1 | [ 3 7 4 9 ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-deepseq.exp: -------------------------------------------------------------------------------- 1 | 456 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-deepseq.nix: -------------------------------------------------------------------------------- 1 | builtins.deepSeq ( 2 | let 3 | as = { 4 | x = 123; 5 | y = as; 6 | }; 7 | in 8 | as 9 | ) 456 10 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-delayed-with-inherit.exp: -------------------------------------------------------------------------------- 1 | "b-overridden" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-delayed-with.exp: -------------------------------------------------------------------------------- 1 | "b-overridden b-overridden a" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-deprecate-cursed-or.exp: -------------------------------------------------------------------------------- 1 | 0 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-derivation-legacy.exp: -------------------------------------------------------------------------------- 1 | "/nix/store/mzgwvrjjir216ra58mwwizi8wj6y9ddr-eval-okay-derivation-legacy" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-dynamic-attrs-2.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-dynamic-attrs-2.nix: -------------------------------------------------------------------------------- 1 | { 2 | a."${"b"}" = true; 3 | a."${"c"}" = false; 4 | } 5 | .a.b 6 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-dynamic-attrs-bare.exp: -------------------------------------------------------------------------------- 1 | { binds = true; hasAttrs = true; multiAttrs = true; recBinds = true; selectAttrs = true; selectOrAttrs = true; } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-dynamic-attrs.exp: -------------------------------------------------------------------------------- 1 | { binds = true; hasAttrs = true; multiAttrs = true; recBinds = true; selectAttrs = true; selectOrAttrs = true; } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-elem.exp: -------------------------------------------------------------------------------- 1 | [ true false 30 ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-elem.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | let 4 | xs = range 10 40; 5 | in 6 | 7 | [ 8 | (builtins.elem 23 xs) 9 | (builtins.elem 42 xs) 10 | (builtins.elemAt xs 20) 11 | ] 12 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-empty-args.exp: -------------------------------------------------------------------------------- 1 | "ab" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-empty-args.nix: -------------------------------------------------------------------------------- 1 | ({ }: { x, y }: "${x}${y}") { } { 2 | x = "a"; 3 | y = "b"; 4 | } 5 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-eq-derivations.exp: -------------------------------------------------------------------------------- 1 | [ true true true false ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-eq.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-eq.nix: -------------------------------------------------------------------------------- 1 | [ 2 | "foobar" 3 | (rec { 4 | x = 1; 5 | y = x; 6 | }) 7 | ] == [ 8 | ("foo" + "bar") 9 | ({ 10 | x = 1; 11 | y = 1; 12 | }) 13 | ] 14 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-filter.exp: -------------------------------------------------------------------------------- 1 | [ 0 2 4 6 8 10 100 102 104 106 108 110 ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-filter.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | builtins.filter (x: x / 2 * 2 == x) ( 4 | builtins.concatLists [ 5 | (range 0 10) 6 | (range 100 110) 7 | ] 8 | ) 9 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-flake-ref-to-string.exp: -------------------------------------------------------------------------------- 1 | "github:NixOS/nixpkgs/23.05?dir=lib" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-flake-ref-to-string.nix: -------------------------------------------------------------------------------- 1 | builtins.flakeRefToString { 2 | type = "github"; 3 | owner = "NixOS"; 4 | repo = "nixpkgs"; 5 | ref = "23.05"; 6 | dir = "lib"; 7 | } 8 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-flatten.exp: -------------------------------------------------------------------------------- 1 | "1234567" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-flatten.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | let { 4 | 5 | l = [ 6 | "1" 7 | "2" 8 | [ 9 | "3" 10 | [ "4" ] 11 | [ 12 | "5" 13 | "6" 14 | ] 15 | ] 16 | "7" 17 | ]; 18 | 19 | body = concat (flatten l); 20 | } 21 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-float.exp: -------------------------------------------------------------------------------- 1 | [ 3.4 3.5 2.5 1.5 ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-floor-ceil.exp: -------------------------------------------------------------------------------- 1 | "23;24;23;23" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/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 ";" ( 10 | map toString [ 11 | n1 12 | n2 13 | n3 14 | n4 15 | ] 16 | ) 17 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-foldlStrict-lazy-elements.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-foldlStrict-lazy-elements.nix: -------------------------------------------------------------------------------- 1 | # Tests that the rhs argument of op is not forced unconditionally 2 | let 3 | lst = builtins.foldl' (acc: x: acc ++ [ x ]) [ ] [ 42 (throw "this shouldn't be evaluated") ]; 4 | in 5 | 6 | builtins.head lst 7 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-foldlStrict-lazy-initial-accumulator.exp: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-foldlStrict-lazy-initial-accumulator.nix: -------------------------------------------------------------------------------- 1 | # Checks that the nul value for the accumulator is not forced unconditionally. 2 | # Some languages provide a foldl' that is strict in this argument, but Nix does not. 3 | builtins.foldl' (_: x: x) (throw "This is never forced") [ 4 | "but the results of applying op are" 5 | 42 6 | ] 7 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-foldlStrict.exp: -------------------------------------------------------------------------------- 1 | 500500 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-foldlStrict.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | builtins.foldl' (x: y: x + y) 0 (range 1 1000) 4 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-fromTOML-timestamps.flags: -------------------------------------------------------------------------------- 1 | --extra-experimental-features parse-toml-timestamps 2 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-fromjson.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-getattrpos-functionargs.exp: -------------------------------------------------------------------------------- 1 | { column = 11; file = "eval-okay-getattrpos-functionargs.nix"; line = 2; } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-getattrpos-functionargs.nix: -------------------------------------------------------------------------------- 1 | let 2 | fun = { foo }: { }; 3 | pos = builtins.unsafeGetAttrPos "foo" (builtins.functionArgs fun); 4 | in 5 | { 6 | inherit (pos) column line; 7 | file = baseNameOf pos.file; 8 | } 9 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-getattrpos-undefined.exp: -------------------------------------------------------------------------------- 1 | null 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-getattrpos-undefined.nix: -------------------------------------------------------------------------------- 1 | builtins.unsafeGetAttrPos "abort" builtins 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-getattrpos.exp: -------------------------------------------------------------------------------- 1 | { column = 5; file = "eval-okay-getattrpos.nix"; line = 3; } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-getattrpos.nix: -------------------------------------------------------------------------------- 1 | let 2 | as = { 3 | foo = "bar"; 4 | }; 5 | pos = builtins.unsafeGetAttrPos "foo" as; 6 | in 7 | { 8 | inherit (pos) column line; 9 | file = baseNameOf pos.file; 10 | } 11 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-getenv.exp: -------------------------------------------------------------------------------- 1 | "foobar" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-getenv.nix: -------------------------------------------------------------------------------- 1 | builtins.getEnv "TEST_VAR" + (if builtins.getEnv "NO_SUCH_VAR" == "" then "bar" else "bla") 2 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-groupBy.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | builtins.groupBy (n: builtins.substring 0 1 (builtins.hashString "sha256" (toString n))) ( 4 | range 0 31 5 | ) 6 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-hash.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/tests/functional/lang/eval-okay-hash.exp -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-hashfile.nix: -------------------------------------------------------------------------------- 1 | let 2 | paths = [ 3 | ./data 4 | ./binary-data 5 | ]; 6 | in 7 | builtins.concatLists ( 8 | map (hash: map (builtins.hashFile hash) paths) [ 9 | "md5" 10 | "sha1" 11 | "sha256" 12 | "sha512" 13 | ] 14 | ) 15 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-hashstring.nix: -------------------------------------------------------------------------------- 1 | let 2 | strings = [ 3 | "" 4 | "text 1" 5 | "text 2" 6 | ]; 7 | in 8 | builtins.concatLists ( 9 | map (hash: map (builtins.hashString hash) strings) [ 10 | "md5" 11 | "sha1" 12 | "sha256" 13 | "sha512" 14 | ] 15 | ) 16 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-if.exp: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-if.nix: -------------------------------------------------------------------------------- 1 | if "foo" != "f" + "oo" then 2 | 1 3 | else if false then 4 | 2 5 | else 6 | 3 7 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-import.exp: -------------------------------------------------------------------------------- 1 | [ 1 2 3 4 5 6 7 8 9 10 ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-import.nix: -------------------------------------------------------------------------------- 1 | let 2 | 3 | overrides = { 4 | import = fn: scopedImport overrides fn; 5 | 6 | scopedImport = attrs: fn: scopedImport (overrides // attrs) fn; 7 | 8 | builtins = builtins // overrides; 9 | } // import ./lib.nix; 10 | 11 | in 12 | scopedImport overrides ./imported.nix 13 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-inherit-attr-pos.exp: -------------------------------------------------------------------------------- 1 | [ { column = 17; file = "/pwd/lang/eval-okay-inherit-attr-pos.nix"; line = 4; } { column = 19; file = "/pwd/lang/eval-okay-inherit-attr-pos.nix"; line = 4; } { column = 21; file = "/pwd/lang/eval-okay-inherit-attr-pos.nix"; line = 5; } { column = 23; file = "/pwd/lang/eval-okay-inherit-attr-pos.nix"; line = 5; } ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-inherit-attr-pos.nix: -------------------------------------------------------------------------------- 1 | let 2 | d = 0; 3 | x = 1; 4 | y = { inherit d x; }; 5 | z = { inherit (y) d x; }; 6 | in 7 | [ 8 | (builtins.unsafeGetAttrPos "d" y) 9 | (builtins.unsafeGetAttrPos "x" y) 10 | (builtins.unsafeGetAttrPos "d" z) 11 | (builtins.unsafeGetAttrPos "x" z) 12 | ] 13 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-inherit-from.err.exp: -------------------------------------------------------------------------------- 1 | trace: used 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-inherit-from.exp: -------------------------------------------------------------------------------- 1 | [ 1 2 { __overrides = { y = { d = [ ]; }; }; c = [ ]; d = 4; x = { c = [ ]; }; y = «repeated»; } { inner = { c = 3; d = 4; }; } ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-let.exp: -------------------------------------------------------------------------------- 1 | "foobar" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-let.nix: -------------------------------------------------------------------------------- 1 | let { 2 | x = "foo"; 3 | y = "bar"; 4 | body = x + y; 5 | } 6 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-list.exp: -------------------------------------------------------------------------------- 1 | "foobarblatest" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-list.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | let { 4 | 5 | body = concat [ 6 | "foo" 7 | "bar" 8 | "bla" 9 | "test" 10 | ]; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-listtoattrs.exp: -------------------------------------------------------------------------------- 1 | "AAbar" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-logic.exp: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-logic.nix: -------------------------------------------------------------------------------- 1 | assert !false && (true || false) -> true; 2 | 1 3 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-map.exp: -------------------------------------------------------------------------------- 1 | "foobarblabarxyzzybar" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-map.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | concat ( 4 | map (x: x + "bar") [ 5 | "foo" 6 | "bla" 7 | "xyzzy" 8 | ] 9 | ) 10 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-mapattrs.exp: -------------------------------------------------------------------------------- 1 | { x = "x-foo"; y = "y-bar"; } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-mapattrs.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | builtins.mapAttrs (name: value: name + "-" + value) { 4 | x = "foo"; 5 | y = "bar"; 6 | } 7 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-merge-dynamic-attrs.exp: -------------------------------------------------------------------------------- 1 | { set1 = { a = 1; b = 2; }; set2 = { a = 1; b = 2; }; set3 = { a = 1; b = 2; }; set4 = { a = 1; b = 2; }; } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-merge-dynamic-attrs.nix: -------------------------------------------------------------------------------- 1 | { 2 | set1 = { 3 | a = 1; 4 | }; 5 | set1 = { 6 | "${"b" + ""}" = 2; 7 | }; 8 | 9 | set2 = { 10 | "${"b" + ""}" = 2; 11 | }; 12 | set2 = { 13 | a = 1; 14 | }; 15 | 16 | set3.a = 1; 17 | set3."${"b" + ""}" = 2; 18 | 19 | set4."${"b" + ""}" = 2; 20 | set4.a = 1; 21 | } 22 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-nested-with.exp: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-nested-with.nix: -------------------------------------------------------------------------------- 1 | with { x = 1; }; with { x = 2; }; x 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-new-let.exp: -------------------------------------------------------------------------------- 1 | "xyzzyfoobar" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-new-let.nix: -------------------------------------------------------------------------------- 1 | let 2 | 3 | f = 4 | z: 5 | 6 | let 7 | x = "foo"; 8 | y = "bar"; 9 | body = 1; # compat test 10 | in 11 | z + x + y; 12 | 13 | arg = "xyzzy"; 14 | 15 | in 16 | f arg 17 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-null-dynamic-attrs.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-null-dynamic-attrs.nix: -------------------------------------------------------------------------------- 1 | { ${null} = true; } == { } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-overrides.exp: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-overrides.nix: -------------------------------------------------------------------------------- 1 | let 2 | 3 | overrides = { 4 | a = 2; 5 | b = 3; 6 | }; 7 | 8 | in 9 | (rec { 10 | __overrides = overrides; 11 | x = a; 12 | a = 1; 13 | }).x 14 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-parse-flake-ref.exp: -------------------------------------------------------------------------------- 1 | { dir = "lib"; owner = "NixOS"; ref = "23.05"; repo = "nixpkgs"; type = "github"; } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-parse-flake-ref.nix: -------------------------------------------------------------------------------- 1 | builtins.parseFlakeRef "github:NixOS/nixpkgs/23.05?dir=lib" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-partition.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | builtins.partition (x: x / 2 * 2 == x) ( 4 | builtins.concatLists [ 5 | (range 0 10) 6 | (range 100 110) 7 | ] 8 | ) 9 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-path-string-interpolation.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 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-path-string-interpolation.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 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-path.exp: -------------------------------------------------------------------------------- 1 | [ "/nix/store/ya937r4ydw0l6kayq8jkyqaips9c75jm-output" "/nix/store/m7y372g6jb0g4hh1dzmj847rd356fhnz-output" ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-pathexists.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-patterns.exp: -------------------------------------------------------------------------------- 1 | "abcxyzDDDDEFijk" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-print.err.exp: -------------------------------------------------------------------------------- 1 | trace: [ «thunk» ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-print.exp: -------------------------------------------------------------------------------- 1 | [ null [ [ «repeated» ] ] ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-print.nix: -------------------------------------------------------------------------------- 1 | with builtins; 2 | trace 3 | [ (1 + 1) ] 4 | [ 5 | null 6 | toString 7 | (deepSeq "x") 8 | (a: a) 9 | ( 10 | let 11 | x = [ x ]; 12 | in 13 | x 14 | ) 15 | ] 16 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-readDir.exp: -------------------------------------------------------------------------------- 1 | { bar = "regular"; foo = "directory"; ldir = "symlink"; linked = "symlink"; } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-readDir.nix: -------------------------------------------------------------------------------- 1 | builtins.readDir ./readDir 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-readFileType.exp: -------------------------------------------------------------------------------- 1 | { bar = "regular"; foo = "directory"; ldir = "symlink"; linked = "symlink"; } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-readfile.exp: -------------------------------------------------------------------------------- 1 | "builtins.readFile ./eval-okay-readfile.nix\n" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-readfile.nix: -------------------------------------------------------------------------------- 1 | builtins.readFile ./eval-okay-readfile.nix 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-redefine-builtin.exp: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-redefine-builtin.nix: -------------------------------------------------------------------------------- 1 | let 2 | throw = abort "Error!"; 3 | in 4 | (builtins.tryEval ).success 5 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-regex-match.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-regex-split.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-regression-20220122.exp: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-regression-20220122.nix: -------------------------------------------------------------------------------- 1 | ((_: _) 1) + ((__: __) 2) 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-regression-20220125.exp: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-regression-20220125.nix: -------------------------------------------------------------------------------- 1 | ((__curPosFoo: __curPosFoo) 1) + ((__curPosBar: __curPosBar) 2) 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-regrettable-rec-attrset-merge.exp: -------------------------------------------------------------------------------- 1 | 6 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-regrettable-rec-attrset-merge.nix: -------------------------------------------------------------------------------- 1 | # This is for backwards compatibility, not because we like it. 2 | # See https://github.com/NixOS/nix/issues/9020. 3 | { 4 | a = rec { 5 | b = c + 1; 6 | d = 2; 7 | }; 8 | a.c = d + 3; 9 | } 10 | .a.b 11 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-remove.exp: -------------------------------------------------------------------------------- 1 | 456 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-remove.nix: -------------------------------------------------------------------------------- 1 | let { 2 | attrs = { 3 | x = 123; 4 | y = 456; 5 | }; 6 | 7 | body = (removeAttrs attrs [ "x" ]).y; 8 | } 9 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-repeated-empty-attrs.exp: -------------------------------------------------------------------------------- 1 | [ { } { } ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-repeated-empty-attrs.nix: -------------------------------------------------------------------------------- 1 | # Tests that empty attribute sets are not printed as `«repeated»`. 2 | [ 3 | { } 4 | { } 5 | ] 6 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-repeated-empty-list.exp: -------------------------------------------------------------------------------- 1 | [ [ ] [ ] ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-repeated-empty-list.nix: -------------------------------------------------------------------------------- 1 | [ 2 | [ ] 3 | [ ] 4 | ] 5 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-replacestrings.exp: -------------------------------------------------------------------------------- 1 | [ "faabar" "fbar" "fubar" "faboor" "fubar" "XaXbXcX" "X" "a_b" "fubar" ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-scope-1.exp: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-scope-1.nix: -------------------------------------------------------------------------------- 1 | ( 2 | ( 3 | { x }: 4 | x: 5 | 6 | { 7 | x = 1; 8 | y = x; 9 | } 10 | ) 11 | { x = 2; } 12 | 3 13 | ).y 14 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-scope-2.exp: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-scope-2.nix: -------------------------------------------------------------------------------- 1 | ( 2 | ( 3 | x: 4 | { x }: 5 | rec { 6 | x = 1; 7 | y = x; 8 | } 9 | ) 10 | 2 11 | { x = 3; } 12 | ).y 13 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-scope-3.exp: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-scope-3.nix: -------------------------------------------------------------------------------- 1 | ( 2 | ( 3 | x: as: 4 | { x }: 5 | rec { 6 | inherit (as) x; 7 | y = x; 8 | } 9 | ) 10 | 2 11 | { x = 4; } 12 | { x = 3; } 13 | ).y 14 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-scope-4.exp: -------------------------------------------------------------------------------- 1 | "ccdd" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-scope-4.nix: -------------------------------------------------------------------------------- 1 | let { 2 | 3 | x = "a"; 4 | y = "b"; 5 | 6 | f = 7 | { 8 | x ? y, 9 | y ? x, 10 | }: 11 | x + y; 12 | 13 | body = f { x = "c"; } + f { y = "d"; }; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-scope-6.exp: -------------------------------------------------------------------------------- 1 | "ccdd" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-scope-6.nix: -------------------------------------------------------------------------------- 1 | let { 2 | 3 | f = 4 | { 5 | x ? y, 6 | y ? x, 7 | }: 8 | x + y; 9 | 10 | body = f { x = "c"; } + f { y = "d"; }; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-scope-7.exp: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-scope-7.nix: -------------------------------------------------------------------------------- 1 | rec { 2 | inherit (x) y; 3 | x = { 4 | y = 1; 5 | }; 6 | } 7 | .y 8 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-search-path.exp: -------------------------------------------------------------------------------- 1 | "abccX" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-search-path.flags: -------------------------------------------------------------------------------- 1 | -I lang/dir1 -I lang/dir2 -I dir5=lang/dir3 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-seq.exp: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-seq.nix: -------------------------------------------------------------------------------- 1 | builtins.seq 1 2 2 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-splitversion.exp: -------------------------------------------------------------------------------- 1 | [ "1" "2" "3" ] 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-splitversion.nix: -------------------------------------------------------------------------------- 1 | builtins.splitVersion "1.2.3" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-string.exp: -------------------------------------------------------------------------------- 1 | "foobar/a/b/c/d/foo/xyzzy/foo.txt/../foo/x/yescape: \"quote\" \n \\end\nof\nlinefoobarblaatfoo$bar$\"$\"$" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-string.nix: -------------------------------------------------------------------------------- 1 | "foo" 2 | + "bar" 3 | + toString (/a/b + /c/d) 4 | + toString (/foo/bar + "/../xyzzy/." + "/foo.txt") 5 | + ("/../foo" + toString /x/y) 6 | + "escape: \"quote\" \n \\" 7 | + "end 8 | of 9 | line" 10 | + "foo${if true then "b${"a" + "r"}" else "xyzzy"}blaat" 11 | + "foo$bar" 12 | + "$\"$\"" 13 | + "$" 14 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-strings-as-attrs-names.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-substring-context.exp: -------------------------------------------------------------------------------- 1 | "okay" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-substring.exp: -------------------------------------------------------------------------------- 1 | "ooxfoobarybarzobaabbc_bad" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-symlink-resolution.exp: -------------------------------------------------------------------------------- 1 | "test" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-symlink-resolution.nix: -------------------------------------------------------------------------------- 1 | import symlink-resolution/foo/overlays/overlay.nix 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-tail-call-1.exp-disabled: -------------------------------------------------------------------------------- 1 | 100000 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-tail-call-1.nix: -------------------------------------------------------------------------------- 1 | let 2 | f = n: if n == 100000 then n else f (n + 1); 3 | in 4 | f 0 5 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-toxml.exp: -------------------------------------------------------------------------------- 1 | "\n\n \n \n \n \n \n\n" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-toxml2.exp: -------------------------------------------------------------------------------- 1 | "\n\n \n \n \n \n \n \n \n \n \n \n \n \n\n" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-toxml2.nix: -------------------------------------------------------------------------------- 1 | builtins.toXML [ 2 | ("a" + "b") 3 | 10 4 | (rec { 5 | x = "x"; 6 | y = x; 7 | }) 8 | ] 9 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-tryeval.exp: -------------------------------------------------------------------------------- 1 | { x = { success = true; value = "x"; }; y = { success = false; value = false; }; z = { success = false; value = false; }; } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-tryeval.nix: -------------------------------------------------------------------------------- 1 | { 2 | x = builtins.tryEval "x"; 3 | y = builtins.tryEval ( 4 | assert false; 5 | "y" 6 | ); 7 | z = builtins.tryEval (throw "bla"); 8 | } 9 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-versions.exp: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-with.exp: -------------------------------------------------------------------------------- 1 | "xyzzybarxyzzybar" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/eval-okay-zipAttrsWith.nix: -------------------------------------------------------------------------------- 1 | with import ./lib.nix; 2 | 3 | let 4 | str = builtins.hashString "sha256" "test"; 5 | in 6 | builtins.zipAttrsWith (n: v: { inherit n v; }) ( 7 | map (n: { ${builtins.substring n 1 str} = n; }) (range 0 31) 8 | ) 9 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/imported2.nix: -------------------------------------------------------------------------------- 1 | range 6 10 2 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-dup-attrs-1.err.exp: -------------------------------------------------------------------------------- 1 | error: attribute 'x' already defined at «stdin»:1:3 2 | at «stdin»:3:3: 3 | 2| y = 456; 4 | 3| x = 789; 5 | | ^ 6 | 4| } 7 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-dup-attrs-1.nix: -------------------------------------------------------------------------------- 1 | { x = 123; 2 | y = 456; 3 | x = 789; 4 | } 5 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-dup-attrs-2.err.exp: -------------------------------------------------------------------------------- 1 | error: attribute 'x' already defined at «stdin»:9:5 2 | at «stdin»:10:18: 3 | 9| x = 789; 4 | 10| inherit (as) x; 5 | | ^ 6 | 11| }; 7 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-dup-attrs-3.err.exp: -------------------------------------------------------------------------------- 1 | error: attribute 'x' already defined at «stdin»:9:5 2 | at «stdin»:10:18: 3 | 9| x = 789; 4 | 10| inherit (as) x; 5 | | ^ 6 | 11| }; 7 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-dup-attrs-4.err.exp: -------------------------------------------------------------------------------- 1 | error: attribute 'services.ssh.port' already defined at «stdin»:2:3 2 | at «stdin»:3:3: 3 | 2| services.ssh.port = 22; 4 | 3| services.ssh.port = 23; 5 | | ^ 6 | 4| } 7 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-dup-attrs-4.nix: -------------------------------------------------------------------------------- 1 | { 2 | services.ssh.port = 22; 3 | services.ssh.port = 23; 4 | } 5 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-dup-attrs-7.err.exp: -------------------------------------------------------------------------------- 1 | error: attribute 'x' already defined at «stdin»:6:13 2 | at «stdin»:7:13: 3 | 6| inherit x; 4 | 7| inherit x; 5 | | ^ 6 | 8| }; 7 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-dup-attrs-7.nix: -------------------------------------------------------------------------------- 1 | rec { 2 | 3 | x = 1; 4 | 5 | as = { 6 | inherit x; 7 | inherit x; 8 | }; 9 | } -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-dup-formals.err.exp: -------------------------------------------------------------------------------- 1 | error: duplicate formal function argument 'x' 2 | at «stdin»:1:8: 3 | 1| {x, y, x}: x 4 | | ^ 5 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-dup-formals.nix: -------------------------------------------------------------------------------- 1 | {x, y, x}: x -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-eof-in-string.err.exp: -------------------------------------------------------------------------------- 1 | error: syntax error, unexpected end of file, expecting '"' 2 | at «stdin»:3:6: 3 | 2| # Note that this file must not end with a newline. 4 | 3| a 1"$ 5 | | ^ 6 | -------------------------------------------------------------------------------- /tests/functional/lang/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"$ -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-eof-pos.err.exp: -------------------------------------------------------------------------------- 1 | error: syntax error, unexpected end of file 2 | at «stdin»:3:1: 3 | 2| # no content 4 | 3| 5 | | ^ 6 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-eof-pos.nix: -------------------------------------------------------------------------------- 1 | ( 2 | # no content 3 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-mixed-nested-attrs1.err.exp: -------------------------------------------------------------------------------- 1 | error: attribute 'x.z' already defined at «stdin»:2:3 2 | at «stdin»:3:16: 3 | 2| x.z = 3; 4 | 3| x = { y = 3; z = 3; }; 5 | | ^ 6 | 4| } 7 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-mixed-nested-attrs1.nix: -------------------------------------------------------------------------------- 1 | { 2 | x.z = 3; 3 | x = { y = 3; z = 3; }; 4 | } 5 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-mixed-nested-attrs2.err.exp: -------------------------------------------------------------------------------- 1 | error: attribute 'x.y.y' already defined at «stdin»:2:3 2 | at «stdin»:3:9: 3 | 2| x.y.y = 3; 4 | 3| x = { y.y= 3; z = 3; }; 5 | | ^ 6 | 4| } 7 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-mixed-nested-attrs2.nix: -------------------------------------------------------------------------------- 1 | { 2 | x.y.y = 3; 3 | x = { y.y= 3; z = 3; }; 4 | } 5 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-patterns-1.err.exp: -------------------------------------------------------------------------------- 1 | error: duplicate formal function argument 'args' 2 | at «stdin»:1:1: 3 | 1| args@{args, x, y, z}: x 4 | | ^ 5 | 2| 6 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-patterns-1.nix: -------------------------------------------------------------------------------- 1 | args@{args, x, y, z}: x 2 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-regression-20060610.err.exp: -------------------------------------------------------------------------------- 1 | error: undefined variable 'gcc' 2 | at «stdin»:9:13: 3 | 8| body = ({ 4 | 9| inherit gcc; 5 | | ^ 6 | 10| }).gcc; 7 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-undef-var-2.err.exp: -------------------------------------------------------------------------------- 1 | error: syntax error, unexpected ':', expecting '}' or ',' 2 | at «stdin»:3:13: 3 | 2| 4 | 3| f = {x, y : ["baz" "bar" z "bat"]}: x + y; 5 | | ^ 6 | 4| 7 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-undef-var.err.exp: -------------------------------------------------------------------------------- 1 | error: undefined variable 'y' 2 | at «stdin»:1:4: 3 | 1| x: y 4 | | ^ 5 | 2| 6 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-undef-var.nix: -------------------------------------------------------------------------------- 1 | x: y 2 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-utf8.err.exp: -------------------------------------------------------------------------------- 1 | error: syntax error, unexpected invalid token, expecting end of file 2 | at «stdin»:1:5: 3 | 1| 123 é 4 4 | | ^ 5 | 2| 6 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-fail-utf8.nix: -------------------------------------------------------------------------------- 1 | 123 é 4 2 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-okay-1.exp: -------------------------------------------------------------------------------- 1 | ({ x, y, z }: ((x + y) + z)) 2 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-okay-1.nix: -------------------------------------------------------------------------------- 1 | {x, y, z}: x + y + z 2 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-okay-crlf.exp: -------------------------------------------------------------------------------- 1 | rec { foo = "multi\nline\n string\n test\r"; x = y; y = 123; z = 456; } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-okay-dup-attrs-5.exp: -------------------------------------------------------------------------------- 1 | { services = { ssh = { enable = true; port = 23; }; }; } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-okay-dup-attrs-5.nix: -------------------------------------------------------------------------------- 1 | { 2 | services.ssh = { enable = true; }; 3 | services.ssh.port = 23; 4 | } 5 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-okay-dup-attrs-6.exp: -------------------------------------------------------------------------------- 1 | { services = { ssh = { enable = true; port = 23; }; }; } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-okay-dup-attrs-6.nix: -------------------------------------------------------------------------------- 1 | { 2 | services.ssh.port = 23; 3 | services.ssh = { enable = true; }; 4 | } 5 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-okay-ind-string.exp: -------------------------------------------------------------------------------- 1 | (let string = "str"; in [ (/some/path) ((/some/path)) ((/some/path)) ((/some/path + "\n end")) (string) ((string)) ((string)) ((string + "\n end")) ("") ("") ("end") ]) 2 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-okay-inherits.exp: -------------------------------------------------------------------------------- 1 | (let b = 2; c = { }; in { inherit b; inherit (c) d e; a = 1; f = 3; }) 2 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-okay-inherits.nix: -------------------------------------------------------------------------------- 1 | let 2 | c = {}; 3 | b = 2; 4 | in { 5 | a = 1; 6 | inherit b; 7 | inherit (c) d e; 8 | f = 3; 9 | } 10 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-okay-mixed-nested-attrs-1.exp: -------------------------------------------------------------------------------- 1 | { x = { q = 3; y = 3; z = 3; }; } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-okay-mixed-nested-attrs-1.nix: -------------------------------------------------------------------------------- 1 | { 2 | x = { y = 3; z = 3; }; 3 | x.q = 3; 4 | } 5 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-okay-mixed-nested-attrs-2.exp: -------------------------------------------------------------------------------- 1 | { x = { q = 3; y = 3; z = 3; }; } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-okay-mixed-nested-attrs-2.nix: -------------------------------------------------------------------------------- 1 | { 2 | x.q = 3; 3 | x = { y = 3; z = 3; }; 4 | } 5 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-okay-mixed-nested-attrs-3.exp: -------------------------------------------------------------------------------- 1 | { services = { httpd = { enable = true; }; ssh = { enable = true; port = 123; }; }; } 2 | -------------------------------------------------------------------------------- /tests/functional/lang/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 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-okay-regression-20041027.exp: -------------------------------------------------------------------------------- 1 | ({ fetchurl, stdenv }: ((stdenv).mkDerivation { name = "libXi-6.0.1"; src = (fetchurl { md5 = "7e935a42428d63a387b3c048be0f2756"; url = "http://freedesktop.org/~xlibs/release/libXi-6.0.1.tar.bz2"; }); })) 2 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-okay-regression-751.exp: -------------------------------------------------------------------------------- 1 | (let const = (a: "const"); in ((const { x = "q"; }))) 2 | -------------------------------------------------------------------------------- /tests/functional/lang/parse-okay-regression-751.nix: -------------------------------------------------------------------------------- 1 | let const = a: "const"; in 2 | ''${ const { x = "q"; }}'' 3 | -------------------------------------------------------------------------------- /tests/functional/lang/readDir/bar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/tests/functional/lang/readDir/bar -------------------------------------------------------------------------------- /tests/functional/lang/readDir/foo/git-hates-directories: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/tests/functional/lang/readDir/foo/git-hates-directories -------------------------------------------------------------------------------- /tests/functional/lang/readDir/ldir: -------------------------------------------------------------------------------- 1 | foo -------------------------------------------------------------------------------- /tests/functional/lang/readDir/linked: -------------------------------------------------------------------------------- 1 | foo/git-hates-directories -------------------------------------------------------------------------------- /tests/functional/lang/symlink-resolution/broken: -------------------------------------------------------------------------------- 1 | nonexistent -------------------------------------------------------------------------------- /tests/functional/lang/symlink-resolution/foo/lib/default.nix: -------------------------------------------------------------------------------- 1 | "test" 2 | -------------------------------------------------------------------------------- /tests/functional/lang/symlink-resolution/foo/overlays: -------------------------------------------------------------------------------- 1 | ../overlays -------------------------------------------------------------------------------- /tests/functional/lang/symlink-resolution/overlays/overlay.nix: -------------------------------------------------------------------------------- 1 | import ../lib 2 | -------------------------------------------------------------------------------- /tests/functional/local-overlay-store/add-lower.sh: -------------------------------------------------------------------------------- 1 | source common.sh 2 | source ../common/init.sh 3 | 4 | requireEnvironment 5 | setupConfig 6 | execUnshare ./add-lower-inner.sh 7 | -------------------------------------------------------------------------------- /tests/functional/local-overlay-store/build.sh: -------------------------------------------------------------------------------- 1 | source common.sh 2 | source ../common/init.sh 3 | 4 | requireEnvironment 5 | setupConfig 6 | execUnshare ./build-inner.sh 7 | -------------------------------------------------------------------------------- /tests/functional/local-overlay-store/check-post-init.sh: -------------------------------------------------------------------------------- 1 | source common.sh 2 | source ../common/init.sh 3 | 4 | requireEnvironment 5 | setupConfig 6 | execUnshare ./check-post-init-inner.sh 7 | -------------------------------------------------------------------------------- /tests/functional/local-overlay-store/delete-duplicate.sh: -------------------------------------------------------------------------------- 1 | source common.sh 2 | source ../common/init.sh 3 | 4 | requireEnvironment 5 | setupConfig 6 | execUnshare ./delete-duplicate-inner.sh 7 | -------------------------------------------------------------------------------- /tests/functional/local-overlay-store/delete-refs.sh: -------------------------------------------------------------------------------- 1 | source common.sh 2 | source ../common/init.sh 3 | 4 | requireEnvironment 5 | setupConfig 6 | execUnshare ./delete-refs-inner.sh 7 | -------------------------------------------------------------------------------- /tests/functional/local-overlay-store/gc.sh: -------------------------------------------------------------------------------- 1 | source common.sh 2 | source ../common/init.sh 3 | 4 | requireEnvironment 5 | setupConfig 6 | execUnshare ./gc-inner.sh 7 | -------------------------------------------------------------------------------- /tests/functional/local-overlay-store/optimise.sh: -------------------------------------------------------------------------------- 1 | source common.sh 2 | source ../common/init.sh 3 | 4 | requireEnvironment 5 | setupConfig 6 | execUnshare ./optimise-inner.sh 7 | -------------------------------------------------------------------------------- /tests/functional/local-overlay-store/redundant-add.sh: -------------------------------------------------------------------------------- 1 | source common.sh 2 | source ../common/init.sh 3 | 4 | requireEnvironment 5 | setupConfig 6 | execUnshare ./redundant-add-inner.sh 7 | -------------------------------------------------------------------------------- /tests/functional/local-overlay-store/remount.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | mount -o remount "$1" 3 | -------------------------------------------------------------------------------- /tests/functional/local-overlay-store/stale-file-handle.sh: -------------------------------------------------------------------------------- 1 | source common.sh 2 | source ../common/init.sh 3 | 4 | requireEnvironment 5 | setupConfig 6 | execUnshare ./stale-file-handle-inner.sh 7 | -------------------------------------------------------------------------------- /tests/functional/local-overlay-store/verify.sh: -------------------------------------------------------------------------------- 1 | source common.sh 2 | source ../common/init.sh 3 | 4 | requireEnvironment 5 | setupConfig 6 | execUnshare ./verify-inner.sh 7 | -------------------------------------------------------------------------------- /tests/functional/name-after-node.nar: -------------------------------------------------------------------------------- 1 | nix-archive-1(type directoryentry(node(typeregularcontentshello 2 | )namefoo)) -------------------------------------------------------------------------------- /tests/functional/nix-copy-ssh.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | source nix-copy-ssh-common.sh "ssh" 6 | -------------------------------------------------------------------------------- /tests/functional/nix-daemon-untrusting.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec nix-daemon --force-untrusted "$@" 4 | -------------------------------------------------------------------------------- /tests/functional/nul-character.nar: -------------------------------------------------------------------------------- 1 | nix-archive-1(type directoryentry(namefonode(typeregularcontentshello 2 | ))) -------------------------------------------------------------------------------- /tests/functional/output-normalization.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | testNormalization () { 6 | TODO_NixOS 7 | clearStore 8 | outPath=$(nix-build ./simple.nix --no-out-link) 9 | test "$(stat -c %Y $outPath)" -eq 1 10 | } 11 | 12 | testNormalization 13 | -------------------------------------------------------------------------------- /tests/functional/path-from-hash-part.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | path=$(nix build --no-link --print-out-paths -f simple.nix) 6 | 7 | hash_part=$(basename $path) 8 | hash_part=${hash_part:0:32} 9 | 10 | path2=$(nix store path-from-hash-part $hash_part) 11 | 12 | [[ $path = $path2 ]] 13 | -------------------------------------------------------------------------------- /tests/functional/plugins.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | for ext in so dylib; do 6 | plugin="${_NIX_TEST_BUILD_DIR}/plugins/libplugintest.$ext" 7 | [[ -f "$plugin" ]] && break 8 | done 9 | 10 | res=$(nix --option setting-set true --option plugin-files "$plugin" eval --expr builtins.anotherNull) 11 | 12 | [ "$res"x = "nullx" ] 13 | -------------------------------------------------------------------------------- /tests/functional/plugins/meson.build: -------------------------------------------------------------------------------- 1 | libplugintest = shared_module( 2 | 'plugintest', 3 | 'plugintest.cc', 4 | dependencies : [ 5 | dependency('nix-expr'), 6 | ], 7 | build_by_default : false, 8 | ) 9 | -------------------------------------------------------------------------------- /tests/functional/pure-eval.nix: -------------------------------------------------------------------------------- 1 | { 2 | x = 123; 3 | } 4 | -------------------------------------------------------------------------------- /tests/functional/repl/characterisation/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/tests/functional/repl/characterisation/empty -------------------------------------------------------------------------------- /tests/functional/repl/doc-comment-curried-args.in: -------------------------------------------------------------------------------- 1 | :l doc-comments.nix 2 | :doc curriedArgs 3 | x = curriedArgs 1 4 | "Note that users may not expect this to behave as it currently does" 5 | :doc x 6 | "This won't produce docs; no support for arbitrary values" 7 | :doc x 2 8 | -------------------------------------------------------------------------------- /tests/functional/repl/doc-comment-formals.in: -------------------------------------------------------------------------------- 1 | :l doc-comments.nix 2 | "Note that this is not yet complete" 3 | :doc documentedFormals 4 | -------------------------------------------------------------------------------- /tests/functional/repl/doc-comment-function.expected: -------------------------------------------------------------------------------- 1 | Nix 2 | Type :? for help. 3 | 4 | nix-repl> :doc import ./doc-comment-function.nix 5 | Function defined at /path/to/tests/functional/repl/doc-comment-function.nix:4:1 6 | 7 | 8 | A doc comment for a file that only contains a function 9 | -------------------------------------------------------------------------------- /tests/functional/repl/doc-comment-function.in: -------------------------------------------------------------------------------- 1 | :doc import ./doc-comment-function.nix 2 | -------------------------------------------------------------------------------- /tests/functional/repl/doc-comment-function.nix: -------------------------------------------------------------------------------- 1 | /** 2 | A doc comment for a file that only contains a function 3 | */ 4 | { ... }: { } 5 | -------------------------------------------------------------------------------- /tests/functional/repl/doc-compact.expected: -------------------------------------------------------------------------------- 1 | Nix 2 | Type :? for help. 3 | 4 | nix-repl> :l doc-comments.nix 5 | Added variables. 6 | 7 | nix-repl> :doc compact 8 | Function `compact`\ 9 | … defined at /path/to/tests/functional/repl/doc-comments.nix:27:5 10 | 11 | 12 | boom 13 | -------------------------------------------------------------------------------- /tests/functional/repl/doc-compact.in: -------------------------------------------------------------------------------- 1 | :l doc-comments.nix 2 | :doc compact 3 | -------------------------------------------------------------------------------- /tests/functional/repl/doc-floatedIn.expected: -------------------------------------------------------------------------------- 1 | Nix 2 | Type :? for help. 3 | 4 | nix-repl> :l doc-comments.nix 5 | Added variables. 6 | 7 | nix-repl> :doc floatedIn 8 | Function `floatedIn`\ 9 | … defined at /path/to/tests/functional/repl/doc-comments.nix:21:5 10 | 11 | 12 | This also works. 13 | -------------------------------------------------------------------------------- /tests/functional/repl/doc-floatedIn.in: -------------------------------------------------------------------------------- 1 | :l doc-comments.nix 2 | :doc floatedIn 3 | -------------------------------------------------------------------------------- /tests/functional/repl/doc-functor.in: -------------------------------------------------------------------------------- 1 | :l doc-functor.nix 2 | :doc multiplier 3 | :doc doubler 4 | :doc recursive 5 | :doc recursive2 6 | :doc diverging 7 | :doc helper 8 | :doc helper2 9 | :doc lib.helper3 10 | :doc helper3 11 | -------------------------------------------------------------------------------- /tests/functional/repl/doc-lambda-flavors.in: -------------------------------------------------------------------------------- 1 | :l doc-comments.nix 2 | :doc nonStrict 3 | :doc strict 4 | :doc strictPre 5 | :doc strictPost 6 | -------------------------------------------------------------------------------- /tests/functional/repl/doc-measurement.expected: -------------------------------------------------------------------------------- 1 | Nix 2 | Type :? for help. 3 | 4 | nix-repl> :l doc-comments.nix 5 | Added variables. 6 | 7 | nix-repl> :doc measurement 8 | Function `measurement`\ 9 | … defined at /path/to/tests/functional/repl/doc-comments.nix:15:17 10 | 11 | 12 | 👈 precisely this wide 👉 13 | -------------------------------------------------------------------------------- /tests/functional/repl/doc-measurement.in: -------------------------------------------------------------------------------- 1 | :l doc-comments.nix 2 | :doc measurement 3 | -------------------------------------------------------------------------------- /tests/functional/repl/doc-multiply.in: -------------------------------------------------------------------------------- 1 | :l doc-comments.nix 2 | :doc multiply 3 | -------------------------------------------------------------------------------- /tests/functional/repl/doc-unambiguous.expected: -------------------------------------------------------------------------------- 1 | Nix 2 | Type :? for help. 3 | 4 | nix-repl> :l doc-comments.nix 5 | Added variables. 6 | 7 | nix-repl> :doc unambiguous 8 | Function `unambiguous`\ 9 | … defined at /path/to/tests/functional/repl/doc-comments.nix:37:5 10 | 11 | 12 | Very close 13 | -------------------------------------------------------------------------------- /tests/functional/repl/doc-unambiguous.in: -------------------------------------------------------------------------------- 1 | :l doc-comments.nix 2 | :doc unambiguous 3 | -------------------------------------------------------------------------------- /tests/functional/repl/pretty-print-idempotent.in: -------------------------------------------------------------------------------- 1 | :l pretty-print-idempotent.nix 2 | oneDeep 3 | oneDeep 4 | twoDeep 5 | twoDeep 6 | oneDeepList 7 | oneDeepList 8 | twoDeepList 9 | twoDeepList 10 | -------------------------------------------------------------------------------- /tests/functional/restricted.nix: -------------------------------------------------------------------------------- 1 | 1 + 2 2 | -------------------------------------------------------------------------------- /tests/functional/shell.shebang.expr: -------------------------------------------------------------------------------- 1 | #! @ENV_PROG@ nix-shell 2 | #! nix-shell "{ script, path, ... }: assert path == ./shell.nix; script { }" 3 | #! nix-shell --no-substitute 4 | #! nix-shell --expr 5 | #! nix-shell --arg script "import ./shell.nix" 6 | #! nix-shell --arg path "./shell.nix" 7 | #! nix-shell -A shellDrv 8 | #! nix-shell -i bash 9 | echo "$FOO" 10 | -------------------------------------------------------------------------------- /tests/functional/shell.shebang.rb: -------------------------------------------------------------------------------- 1 | #! @SHELL_PROG@ 2 | #! ruby 3 | #! nix-shell -I nixpkgs=shell.nix --no-substitute 4 | #! nix-shell --pure -p ruby -i ruby 5 | 6 | # Contents doesn't matter. 7 | abort("This shouldn't be executed.") 8 | -------------------------------------------------------------------------------- /tests/functional/shell.shebang.sh: -------------------------------------------------------------------------------- 1 | #! @ENV_PROG@ nix-shell 2 | #! nix-shell -I nixpkgs=shell.nix --no-substitute 3 | #! nix-shell --pure -i bash -p foo bar 4 | echo "$(foo) $(bar) $@" 5 | -------------------------------------------------------------------------------- /tests/functional/simple-failing.nix: -------------------------------------------------------------------------------- 1 | with import ./config.nix; 2 | 3 | mkDerivation { 4 | name = "simple-failing"; 5 | builder = builtins.toFile "builder.sh" '' 6 | echo "This should fail" 7 | exit 1 8 | ''; 9 | PATH = ""; 10 | goodPath = path; 11 | } 12 | -------------------------------------------------------------------------------- /tests/functional/simple.builder.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "PATH=$PATH" 4 | 5 | # Verify that the PATH is empty. 6 | if mkdir foo 2> /dev/null; then exit 1; fi 7 | 8 | # Set a PATH (!!! impure). 9 | export PATH=$goodPath 10 | mkdir "$out" 11 | 12 | echo "Hello World!" > "$out"/hello 13 | -------------------------------------------------------------------------------- /tests/functional/simple.nix: -------------------------------------------------------------------------------- 1 | with import ./config.nix; 2 | 3 | mkDerivation { 4 | name = "simple"; 5 | builder = ./simple.builder.sh; 6 | PATH = ""; 7 | goodPath = path; 8 | meta.position = "${__curPos.file}:${toString __curPos.line}"; 9 | } 10 | -------------------------------------------------------------------------------- /tests/functional/slash.nar: -------------------------------------------------------------------------------- 1 | nix-archive-1(type directoryentry(namex/ynode(typeregularcontentshello 2 | ))) -------------------------------------------------------------------------------- /tests/functional/test-libstoreconsumer.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source common.sh 4 | 5 | drv="$(nix-instantiate simple.nix)" 6 | cat "$drv" 7 | out="$("${_NIX_TEST_BUILD_DIR}/test-libstoreconsumer/test-libstoreconsumer" "$drv")" 8 | grep -F "Hello World!" < "$out/hello" 9 | -------------------------------------------------------------------------------- /tests/functional/test-libstoreconsumer/README.md: -------------------------------------------------------------------------------- 1 | 2 | A very simple C++ consumer of the libstore library. 3 | 4 | - Keep it simple. Library consumers expect something simple. 5 | - No build hook, or any other reinvocations. 6 | - No more global state than necessary. 7 | -------------------------------------------------------------------------------- /tests/functional/test-libstoreconsumer/meson.build: -------------------------------------------------------------------------------- 1 | libstoreconsumer_tester = executable( 2 | 'test-libstoreconsumer', 3 | 'main.cc', 4 | dependencies : [ 5 | dependency('nix-store'), 6 | ], 7 | build_by_default : false, 8 | ) 9 | -------------------------------------------------------------------------------- /tests/functional/tree.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NixOS/nix/d46ce52fac62d2b8dbc95aeb7a31af3a2ae1a78d/tests/functional/tree.tar.gz -------------------------------------------------------------------------------- /tests/functional/undefined-variable.nix: -------------------------------------------------------------------------------- 1 | let 2 | f = builtins.toFile "test-file.nix" "asd"; 3 | in 4 | import f 5 | -------------------------------------------------------------------------------- /tests/functional/user-envs.builder.sh: -------------------------------------------------------------------------------- 1 | mkdir $out 2 | mkdir $out/bin 3 | echo "#! $shell" > $out/bin/$progName 4 | echo "echo $name" >> $out/bin/$progName 5 | chmod +x $out/bin/$progName 6 | -------------------------------------------------------------------------------- /tests/functional/user-envs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | source ./common.sh 4 | 5 | source ./user-envs-test-case.sh 6 | -------------------------------------------------------------------------------- /tests/nixos/cgroups/hang.nix: -------------------------------------------------------------------------------- 1 | { }: 2 | 3 | with import { }; 4 | 5 | runCommand "hang" 6 | { 7 | requiredSystemFeatures = "uid-range"; 8 | } 9 | '' 10 | sleep infinity 11 | '' 12 | -------------------------------------------------------------------------------- /tests/nixos/containers/id-test.nix: -------------------------------------------------------------------------------- 1 | { 2 | name, 3 | uidRange ? false, 4 | }: 5 | 6 | with import { }; 7 | 8 | runCommand name { 9 | requiredSystemFeatures = if uidRange then [ "uid-range" ] else [ ]; 10 | } "id; id > $out" 11 | -------------------------------------------------------------------------------- /tests/nixos/functional/as-root.nix: -------------------------------------------------------------------------------- 1 | { 2 | name = "functional-tests-on-nixos_root"; 3 | 4 | imports = [ ./common.nix ]; 5 | 6 | testScript = '' 7 | machine.wait_for_unit("multi-user.target") 8 | machine.succeed(""" 9 | run-test-suite >&2 10 | """) 11 | ''; 12 | } 13 | --------------------------------------------------------------------------------