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
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.sh
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
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
gc.sh
hash-check.nix
hash.sh
import-derivation.nix
import-derivation.sh
init.sh
install-darwin.sh
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
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
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
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
structured-attrs.nix
structured-attrs.sh
tarball.sh
timeout.nix
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