lix/tests
Eelco Dolstra d4dcffd643
Add pure evaluation mode
In this mode, the following restrictions apply:

* The builtins currentTime, currentSystem and storePath throw an
  error.

* $NIX_PATH and -I are ignored.

* fetchGit and fetchMercurial require a revision hash.

* fetchurl and fetchTarball require a sha256 attribute.

* No file system access is allowed outside of the paths returned by
  fetch{Git,Mercurial,url,Tarball}. Thus 'nix build -f ./foo.nix' is
  not allowed.

Thus, the evaluation result is completely reproducible from the
command line arguments. E.g.

  nix build --pure-eval '(
    let
      nix = fetchGit { url = https://github.com/NixOS/nixpkgs.git; rev = "9c927de4b179a6dd210dd88d34bda8af4b575680"; };
      nixpkgs = fetchGit { url = https://github.com/NixOS/nixpkgs.git; ref = "release-17.09"; rev = "66b4de79e3841530e6d9c6baf98702aa1f7124e4"; };
    in (import (nix + "/release.nix") { inherit nix nixpkgs; }).build.x86_64-linux
  )'

The goal is to enable completely reproducible and traceable
evaluation. For example, a NixOS configuration could be fully
described by a single Git commit hash. 'nixos-rebuild' would do
something like

  nix build --pure-eval '(
    (import (fetchGit { url = file:///my-nixos-config; rev = "..."; })).system
  ')

where the Git repository /my-nixos-config would use further fetchGit
calls or Git externals to fetch Nixpkgs and whatever other
dependencies it has. Either way, the commit hash would uniquely
identify the NixOS configuration and allow it to reproduced.
2018-01-16 19:23:18 +01:00
..
lang Revert "Don't parse "x:x" as a URI" 2017-11-14 15:10:52 +01:00
add.sh
binary-cache.sh Test: Replace --option with the corresponding flag 2017-11-20 17:50:49 +01:00
brotli.sh use libbrotli directly when available 2017-12-30 20:26:33 -06:00
build-hook.nix build-remote: Add a basic test 2017-05-02 15:46:10 +02:00
build-remote.sh Allow shorter syntax for chroot stores 2017-10-24 15:32:38 +02:00
case-hack.sh
case.nar
check-refs.nix
check-refs.sh
check-reqs.nix
check-reqs.sh
common.sh.in use libbrotli directly when available 2017-12-30 20:26:33 -06:00
config.nix Pass lists/attrsets to bash as (associative) arrays 2017-10-25 13:01:50 +02:00
dependencies.builder0.sh
dependencies.builder1.sh
dependencies.builder2.sh
dependencies.nix
dependencies.sh
dump-db.sh
export-graph.nix
export-graph.sh
export.sh
fetchGit.sh Add pure evaluation mode 2018-01-16 19:23:18 +01:00
fetchMercurial.sh Add pure evaluation mode 2018-01-16 19:23:18 +01:00
fetchurl.sh Test: Replace --option with the corresponding flag 2017-11-20 17:50:49 +01:00
filter-source.nix
filter-source.sh
fixed.builder1.sh
fixed.builder2.sh
fixed.nix
fixed.sh
gc-concurrent.builder.sh
gc-concurrent.nix
gc-concurrent.sh
gc-concurrent2.builder.sh
gc-runtime.nix
gc-runtime.sh Fix gc-runtime test 2016-09-12 13:40:07 +02:00
gc.sh
hash-check.nix
hash.sh Support base-64 hashes 2017-07-04 15:07:41 +02:00
import-derivation.nix
import-derivation.sh
init.sh Rename a few configuration options 2017-08-31 14:28:25 +02:00
install-darwin.sh Rename PINCH_ME_IM_SILLY to ALLOW_PREEXISTING_INSTALLATION 2017-07-14 12:11:33 -04:00
lang.sh
linux-sandbox.sh Test: Replace --option with the corresponding flag 2017-11-20 17:50:49 +01:00
local.mk Add pure evaluation mode 2018-01-16 19:23:18 +01:00
logging.sh Test: Replace --option with the corresponding flag 2017-11-20 17:50:49 +01:00
misc.sh
multiple-outputs.nix
multiple-outputs.sh nix-shell/nix-build: Support .drv files again 2017-11-24 18:08:35 +01:00
nar-access.nix Rename tests/nar-index -> tests/nar-access 2017-11-14 13:27:40 +01:00
nar-access.sh nix ls-{nar,store}: Return offset of files in the NAR if known 2017-12-07 01:07:07 +01:00
nix-build.sh nix-shell/nix-build: Support .drv files again 2017-11-24 18:08:35 +01:00
nix-channel.sh Fix tests 2017-10-02 23:45:27 -04:00
nix-copy-closure.nix release.nix: Use fetchTarball and fetchGit 2017-12-22 11:35:32 +01:00
nix-profile.sh
nix-shell.sh nix-shell/nix-build: Support .drv files again 2017-11-24 18:08:35 +01:00
optimise-store.sh Test: Replace --option with the corresponding flag 2017-11-20 17:50:49 +01:00
parallel.builder.sh
parallel.nix
parallel.sh
pass-as-file.sh
placeholders.sh
pure-eval.nix Add pure evaluation mode 2018-01-16 19:23:18 +01:00
pure-eval.sh Add pure evaluation mode 2018-01-16 19:23:18 +01:00
referrers.sh
remote-builds.nix release.nix: Use fetchTarball and fetchGit 2017-12-22 11:35:32 +01:00
remote-store.sh
repair.sh Test: Replace --option with the corresponding flag 2017-11-20 17:50:49 +01:00
restricted.nix Add pure evaluation mode 2018-01-16 19:23:18 +01:00
restricted.sh Add pure evaluation mode 2018-01-16 19:23:18 +01:00
run.nix Add tests for "nix run" 2017-11-20 18:36:36 +01:00
run.sh run.sh: include lib64 in sandbox-paths to fix on ubuntu 16.XX 2017-12-30 22:41:49 -06:00
secure-drv-outputs.nix
secure-drv-outputs.sh
setuid.nix release.nix: Use fetchTarball and fetchGit 2017-12-22 11:35:32 +01:00
shell.nix Fix nix-shell test 2017-04-25 18:59:18 +02:00
shell.shebang.sh Rename "use-substitutes" to "substitute" 2018-01-04 16:58:39 +01:00
signing.sh Fix test 2017-12-07 01:07:07 +01:00
simple.builder.sh
simple.nix
simple.sh Handle $TMPDIR ending with a slash 2016-10-19 15:19:38 +02:00
structured-attrs.nix exportReferencesGraph: Allow exporting a list of store paths 2017-10-25 15:18:49 +02:00
structured-attrs.sh Pass lists/attrsets to bash as (associative) arrays 2017-10-25 13:01:50 +02:00
tarball.sh Fix test failure 2016-09-08 18:22:28 +02:00
timeout.nix Replace Unicode quotes in user-facing strings by ASCII 2017-07-30 12:32:45 +01:00
timeout.sh Test: Replace --option with the corresponding flag 2017-11-20 17:50:49 +01:00
user-envs.builder.sh
user-envs.nix
user-envs.sh