lix/src
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
..
boost Shut up some warnings 2017-04-14 14:42:20 +02:00
build-remote nix.conf: builders-use-substitutes 2018-01-09 22:40:07 +01:00
buildenv Fix "Unexpected EOF reading a line" error 2017-11-29 11:56:15 +00:00
libexpr Add pure evaluation mode 2018-01-16 19:23:18 +01:00
libmain anchor nix::Exit exception 2017-11-14 12:39:30 -06:00
libstore Add pure evaluation mode 2018-01-16 19:23:18 +01:00
libutil Add pure evaluation mode 2018-01-16 19:23:18 +01:00
linenoise linenoise.cpp: allow completions from empty input 2017-12-19 12:52:10 -06:00
nix parseExprFromFile -> evalFile 2018-01-16 17:11:58 +01:00
nix-build Add pure evaluation mode 2018-01-16 19:23:18 +01:00
nix-channel Replace Unicode quotes in user-facing strings by ASCII 2017-07-30 12:32:45 +01:00
nix-collect-garbage printMsg(lvlError, ...) -> printError(...) etc. 2016-09-21 16:54:53 +02:00
nix-copy-closure Replace Unicode quotes in user-facing strings by ASCII 2017-07-30 12:32:45 +01:00
nix-daemon Improve error message with --repair for untrusted users 2018-01-08 19:13:48 +01:00
nix-env nix: Respect -I, --arg, --argstr 2017-10-24 12:58:34 +02:00
nix-instantiate Add pure evaluation mode 2018-01-16 19:23:18 +01:00
nix-prefetch-url nix: Respect -I, --arg, --argstr 2017-10-24 12:58:34 +02:00
nix-store Pass lists/attrsets to bash as (associative) arrays 2017-10-25 13:01:50 +02:00
nlohmann Simplify build by including nlohmann/json.hpp 2017-12-04 17:11:36 +01:00
resolve-system-dependencies Replace Unicode quotes in user-facing strings by ASCII 2017-07-30 12:32:45 +01:00