lix/src/nix
Eelco Dolstra 6644b6099b
Add flake evaluation cache
This exploits the hermetic nature of flake evaluation to speed up
repeated evaluations of a flake output attribute.

For example (doing 'nix build' on an already present package):

  $ time nix build nixpkgs:firefox

  real    0m1.497s
  user    0m1.160s
  sys     0m0.139s

  $ time nix build nixpkgs:firefox

  real    0m0.052s
  user    0m0.038s
  sys     0m0.007s

The cache is ~/.cache/nix/eval-cache-v1.sqlite, which has entries like

  INSERT INTO Attributes VALUES(
    X'92a907d4efe933af2a46959b082cdff176aa5bfeb47a98fabd234809a67ab195',
    'packages.firefox',
    1,
    '/nix/store/pbalzf8x19hckr8cwdv62rd6g0lqgc38-firefox-67.0.drv /nix/store/g6q0gx0v6xvdnizp8lrcw7c4gdkzana0-firefox-67.0 out');

where the hash 92a9... is a fingerprint over the flake store path and
the contents of the lockfile. Because flakes are evaluated in pure
mode, this uniquely identifies the evaluation result.
2019-06-07 22:25:48 +02:00
..
add-to-store.cc experimental/optional -> optional 2019-03-14 14:10:52 +01:00
build.cc Fixed issue #13 2019-04-30 11:26:45 +02:00
cat.cc Replace Unicode quotes in user-facing strings by ASCII 2017-07-30 12:32:45 +01:00
command.cc Implemented --flake flag for nix build 2019-03-22 11:16:20 +01:00
command.hh Add 'nix app' command 2019-06-03 09:27:03 +02:00
copy.cc Don't talk about a "current folder build output" 2018-09-27 21:01:19 +02:00
doctor.cc nix doctor: return nonzero exitcode if a check fails 2018-10-29 12:09:22 +00:00
dump-path.cc Fix #1762 2018-02-13 14:26:19 +00:00
edit.cc Revert "Restore parent mount namespace before executing a child process" 2019-02-05 10:49:19 +01:00
eval.cc nix eval: Stop progress bar before printing the result 2018-01-17 12:04:44 +01:00
flake-template.nix Made epochs more fine-grained 2019-06-03 14:47:47 +02:00
flake.cc Move flake-related stuff to src/libexpr/flake 2019-06-05 16:51:54 +02:00
hash.cc Support SRI hashes 2018-12-13 14:30:52 +01:00
installables.cc Add flake evaluation cache 2019-06-07 22:25:48 +02:00
legacy.cc Start of new Nix command-line interface 2016-02-09 21:28:29 +01:00
legacy.hh Fix Darwin build 2016-03-15 12:11:27 +01:00
local.mk Move flake template into a separate file 2019-04-08 23:39:38 +02:00
log.cc nix log: use pager 2018-01-12 15:05:26 -06:00
ls.cc nix ls-nar: allow reading from FIFOs 2018-11-16 16:24:36 +01:00
main.cc Merge remote-tracking branch 'origin/master' into flakes 2019-05-15 20:51:29 +02:00
optimise-store.cc nix optimise-store: Add 2017-08-16 20:56:03 +02:00
path-info.cc nix path-info: Remove trailing spaces 2018-09-01 00:04:57 +02:00
ping-store.cc Manual: Update chapter on remote builds 2018-02-21 16:24:26 +01:00
progress-bar.cc Merge pull request #2800 from flokli/progress-bar-hide-unknown-expected 2019-05-21 13:29:28 +02:00
progress-bar.hh nix: Add --print-build-logs flag 2019-05-15 17:33:56 +02:00
repl.cc repl: Restore CTRL-C behaviour 2019-03-24 09:39:48 +00:00
run.cc Add 'nix app' command 2019-06-03 09:27:03 +02:00
search.cc nix: Make -f work for compatibility 2019-04-08 16:11:17 +02:00
shell.cc nix dev-shell: Ignore SSL_CERT_FILE 2019-05-11 01:50:28 +02:00
show-config.cc Modularize config settings 2018-05-30 13:28:01 +02:00
show-derivation.cc Add "nix show-derivation" 2017-09-25 13:43:35 +02:00
sigs.cc nix: Respect -I, --arg, --argstr 2017-10-24 12:58:34 +02:00
upgrade-nix.cc nix upgrade-nix: Handle .nix-profile being a link to .../profiles/per-user/... 2018-08-30 21:18:56 +02:00
verify.cc Fix overflow when verifying signatures of content addressable paths 2018-09-25 21:19:24 -04:00
why-depends.cc nix: Make -f work for compatibility 2019-04-08 16:11:17 +02:00