nix-gh/src/libexpr
Eelco Dolstra 6024dc1d97
Support SRI hashes
SRI hashes (https://www.w3.org/TR/SRI/) combine the hash algorithm and
a base-64 hash. This allows more concise and standard hash
specifications. For example, instead of

  import <nix/fetchurl.nl> {
    url = https://nixos.org/releases/nix/nix-2.1.3/nix-2.1.3.tar.xz;
    sha256 = "5d22dad058d5c800d65a115f919da22938c50dd6ba98c5e3a183172d149840a4";
  };

you can write

  import <nix/fetchurl.nl> {
    url = https://nixos.org/releases/nix/nix-2.1.3/nix-2.1.3.tar.xz;
    hash = "sha256-XSLa0FjVyADWWhFfkZ2iKTjFDda6mMXjoYMXLRSYQKQ=";
  };

In fixed-output derivations, the outputHashAlgo is no longer mandatory
if outputHash specifies the hash (either as an SRI or in the old
"<type>:<hash>" format).

'nix hash-{file,path}' now print hashes in SRI format by default. I
also reverted them to use SHA-256 by default because that's what we're
using most of the time in Nixpkgs.

Suggested by @zimbatm.
2018-12-13 14:30:52 +01:00
..
primops Solve hg "abandoned transaction" issue 2018-12-06 13:57:59 +01:00
attr-path.cc Replace Unicode quotes in user-facing strings by ASCII 2017-07-30 12:32:45 +01:00
attr-path.hh Work on Values instead of Exprs 2013-09-03 13:17:51 +00:00
attr-set.cc Remove duplicate definition of allocBytes() 2018-06-12 17:49:51 +02:00
attr-set.hh libexpr: Don't create lots of temporary strings in Bindings::lexicographicOrder 2018-02-19 22:47:25 +02:00
common-eval-args.cc nix: Respect -I, --arg, --argstr 2017-10-24 12:58:34 +02:00
common-eval-args.hh Fix build 2017-11-01 21:32:30 +01:00
eval-inline.hh GC_malloc -> GC_MALLOC 2018-06-12 17:49:55 +02:00
eval.cc Convert NIX_COUNT_CALLS to JSON too 2018-09-05 21:57:54 +02:00
eval.hh Remove unused function printStats2() 2018-07-11 20:29:18 +02:00
get-drvs.cc nix-shell/nix-build: Support .drv files again 2017-11-24 18:08:35 +01:00
get-drvs.hh Fix typo in comments 2018-10-31 20:50:18 +01:00
json-to-value.cc json-to-value: Use strtol instead of strtoi 2018-05-26 18:43:46 -04:00
json-to-value.hh Add builtin function ‘fromJSON’ 2014-07-04 13:34:15 +02:00
lexer.l simplify handling of extra '}' 2018-10-27 00:14:51 +02:00
local.mk Revert "Fix parser/lexer generation with parallel make" 2018-08-23 00:23:35 +02:00
names.cc Add splitVersion primop. 2018-02-14 09:55:43 -05:00
names.hh Add splitVersion primop. 2018-02-14 09:55:43 -05:00
nix-expr.pc.in Export required C++ version in pkgconfig. 2018-04-09 11:32:43 -04:00
nixexpr.cc Fix compatibility with latest boost::format 2018-03-14 19:25:09 +01:00
nixexpr.hh Revert "Throw a specific error for incomplete parse errors." 2018-05-11 11:40:50 +02:00
parser.y parser.y: right-associativity of -> 2018-07-23 07:28:48 +00:00
primops.cc Support SRI hashes 2018-12-13 14:30:52 +01:00
primops.hh Make prim_exec and prim_importNative available to plugins 2018-04-09 10:26:50 -04:00
symbol-table.hh Fix some random -Wconversion warnings 2018-05-02 13:56:34 +02:00
value-to-json.cc nix path-info: Add --json flag 2016-08-29 17:29:24 +02:00
value-to-json.hh nix path-info: Add --json flag 2016-08-29 17:29:24 +02:00
value-to-xml.cc First hit at providing support for floats in the language. 2016-01-05 00:40:40 +01:00
value-to-xml.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
value.hh libexpr: Use int64_t for NixInt 2018-08-29 01:05:52 +02:00