lix/src/libstore
Eelco Dolstra d367b8e787 Add build mode to compute fixed-output derivation hashes
For example,

  $ nix-build --hash -A nix-repl.src

will build the fixed-output derivation nix-repl.src (a fetchFromGitHub
call), but instead of *verifying* the hash given in the Nix
expression, it prints out the resulting hash, and then moves the
result to its content-addressed location in the Nix store. E.g

  build produced path ‘/nix/store/504a4k6zi69dq0yjc0bm12pa65bccxam-nix-repl-8a2f5f0607540ffe56b56d52db544373e1efb980-src’ with sha256 hash ‘0cjablz01i0g9smnavhf86imwx1f9mnh5flax75i615ml71gsr88’

The goal of this is to make all nix-prefetch-* scripts unnecessary: we
can just let Nix run the real thing (i.e., the corresponding fetch*
derivation).

Another example:

  $ nix-build --hash -E 'with import <nixpkgs> {}; fetchgit { url = "https://github.com/NixOS/nix.git"; sha256 = "ffffffffffffffffffffffffffffffffffffffffffffffffffff"; }'
  ...
  git revision is 9e7c1a4bbd
  ...
  build produced path ‘/nix/store/gmsnh9i7x4mb7pyd2ns7n3c9l90jfsi1-nix’ with sha256 hash ‘1188xb621diw89n25rifqg9lxnzpz7nj5bfh4i1y3dnis0dmc0zp’

(Having to specify a fake sha256 hash is a bit annoying...)
2016-01-31 12:18:09 +01:00
..
build.cc Add build mode to compute fixed-output derivation hashes 2016-01-31 12:18:09 +01:00
builtins.cc <nix/fetchurl.nix>: Support xz-compressed NARs 2015-10-30 12:34:30 +01:00
builtins.hh Make <nix/fetchurl.nix> a builtin builder 2015-07-20 04:38:46 +02:00
derivations.cc OCD: foreach -> C++11 ranged for 2015-07-17 20:13:56 +02:00
derivations.hh Allow remote builds without sending the derivation closure 2015-07-17 17:57:40 +02:00
download.cc int2String() -> std::to_string() 2015-10-29 13:26:55 +01:00
download.hh Show progress indicator for builtin fetchurl 2015-10-21 15:14:42 +02:00
gc.cc OCD: foreach -> C++11 ranged for 2015-07-17 20:13:56 +02:00
globals.cc move preBuildHook defaulting to globals.cc 2015-10-21 14:39:08 -07:00
globals.hh Add the pre-build hook. 2015-04-18 16:56:02 -04:00
local-store.cc Use the daemon when we don't have write access to the Nix database 2016-01-31 10:28:48 +01:00
local-store.hh Use the daemon when we don't have write access to the Nix database 2016-01-31 10:28:48 +01:00
local.mk Merge pull request #704 from ysangkok/freebsd-support 2015-11-24 19:24:21 +01:00
misc.cc OCD: foreach -> C++11 ranged for 2015-07-17 20:13:56 +02:00
misc.hh Allow remote builds without sending the derivation closure 2015-07-17 17:57:40 +02:00
nix-store.pc.in Install some pkgconfig files 2014-09-18 12:00:40 +02:00
optimise-store.cc optimizePath(): Detect some .links corruption 2015-11-09 21:28:25 +01:00
pathlocks.cc ~PathLocks(): Handle exceptions 2016-01-04 11:34:36 +01:00
pathlocks.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
profiles.cc nix-collect-garbage: Don't call nix-env 2015-05-21 16:28:30 +02:00
profiles.hh nix-collect-garbage: Don't call nix-env 2015-05-21 16:28:30 +02:00
references.cc OCD: foreach -> C++11 ranged for 2015-07-17 20:13:56 +02:00
references.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
remote-store.cc Use the daemon when we don't have write access to the Nix database 2016-01-31 10:28:48 +01:00
remote-store.hh Shut up clang warnings 2015-09-18 01:22:35 +02:00
sandbox-defaults.sb.in Revert "remove sandbox-defaults.sb" 2015-11-21 16:40:24 -05:00
schema.sql * Store the size of a store path in the database (to be precise, the 2010-11-16 17:11:46 +00:00
store-api.cc Use the daemon when we don't have write access to the Nix database 2016-01-31 10:28:48 +01:00
store-api.hh Add build mode to compute fixed-output derivation hashes 2016-01-31 12:18:09 +01:00
worker-protocol.hh daemon: Add 'buildMode' parameter to 'buildPaths' RPC 2015-12-02 18:14:49 +01:00