lix/src/libexpr
Eelco Dolstra cc22cf662b Respect lock files of inputs + fine-grained lock file control
When computing a lock file, we now respect the lock files of flake
inputs. This is important for usability / reproducibility. For
example, the 'nixops' flake depends on the 'nixops-aws' and
'nixops-hetzner' repositories. So when the 'nixops' flake is used in
another flake, we want the versions of 'nixops-aws' and
'nixops-hetzner' locked by the the 'nixops' flake because those
presumably have been tested.

This can lead to a proliferation of versions of flakes like 'nixpkgs'
(since every flake's lock file could depend on a different version of
'nixpkgs'). This is not a major issue when using Nixpkgs overlays or
NixOS modules, since then the top-level flake composes those
overlays/modules into *its* version of Nixpkgs and all other versions
are ignored. Lock file computation has been made a bit more lazy so it
won't try to fetch all those versions of 'nixpkgs'.

However, in case it's necessary to minimize flake versions, there now
are two input attributes that allow this. First, you can copy an input
from another flake, as follows:

  inputs.nixpkgs.follows = "dwarffs/nixpkgs";

This states that the calling flake's 'nixpkgs' input shall be the same
as the 'nixpkgs' input of the 'dwarffs' input.

Second, you can override inputs of inputs:

  inputs.nixpkgs.url = github:edolstra/nixpkgs/<hash>;
  inputs.nixops.inputs.nixpkgs.url = github:edolstra/nixpkgs/<hash>;

or equivalently, using 'follows':

  inputs.nixpkgs.url = github:edolstra/nixpkgs/<hash>;
  inputs.nixops.inputs.nixpkgs.follows = "nixpkgs";

This states that the 'nixpkgs' input of the 'nixops' input shall be
the same as the calling flake's 'nixpkgs' input.

Finally, at '-v' Nix now prints the changes to the lock file, e.g.

  $ nix flake update ~/Misc/eelco-configurations/hagbard
  inputs of flake 'git+file:///home/eelco/Misc/eelco-configurations?subdir=hagbard' changed:
    updated 'nixpkgs': 'github:edolstra/nixpkgs/7845bf5f4b3013df1cf036e9c9c3a55a30331db9' -> 'github:edolstra/nixpkgs/03f3def66a104a221aac8b751eeb7075374848fd'
    removed 'nixops'
    removed 'nixops/nixops-aws'
    removed 'nixops/nixops-hetzner'
    removed 'nixops/nixpkgs'
2020-01-24 22:05:11 +01:00
..
flake Respect lock files of inputs + fine-grained lock file control 2020-01-24 22:05:11 +01:00
primops Convert fetchMercurial to a input type 2020-01-21 23:49:32 +01:00
attr-path.cc Merge remote-tracking branch 'origin/master' into flakes 2019-11-06 10:56:33 +01:00
attr-path.hh Merge remote-tracking branch 'origin/master' into flakes 2019-11-06 10:56:33 +01:00
attr-set.cc EvalState::allocAttr(): Add convenience method 2019-02-11 11:55:29 +01:00
attr-set.hh Bindings: Add convenience method for requiring an attribute 2019-12-05 20:29:15 +01:00
common-eval-args.cc Fix --override-flake and add a test 2020-01-22 20:00:58 +01:00
common-eval-args.hh Fix --override-flake and add a test 2020-01-22 20:00:58 +01:00
eval-inline.hh GC_malloc -> GC_MALLOC 2018-06-12 17:49:55 +02:00
eval.cc Merge remote-tracking branch 'origin/master' into flakes 2020-01-21 21:18:52 +01:00
eval.hh Pluggable fetchers 2020-01-21 22:56:04 +01:00
function-trace.cc Fix coverage build 2020-01-22 21:58:07 +01:00
function-trace.hh Hide FunctionCallTrace constructor/destructor 2020-01-05 16:21:34 +01:00
get-drvs.cc nix-store -r: Handle symlinks to store paths 2019-12-16 19:11:47 +01:00
get-drvs.hh experimental/optional -> optional 2019-03-14 14:10:52 +01:00
json-to-value.cc Fix build 2020-01-13 21:34:54 +01:00
json-to-value.hh Fix extra ; warnings involving MakeError 2019-11-10 11:24:47 -05:00
lexer.l simplify handling of extra '}' 2018-10-27 00:14:51 +02:00
local.mk Merge remote-tracking branch 'origin/master' into flakes 2019-12-11 14:53:30 +01:00
names.cc Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
names.hh Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
nix-expr.pc.in pkg-config files: Use c++17 2019-03-14 14:11:12 +01:00
nixexpr.cc Fix compatibility with latest boost::format 2018-03-14 19:25:09 +01:00
nixexpr.hh Fix extra ; warnings involving MakeError 2019-11-10 11:24:47 -05:00
parser.y Tweak error message 2019-12-15 10:44:53 +01:00
primops.cc Merge remote-tracking branch 'origin/master' into flakes 2020-01-21 21:18: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 Make the Store API more type-safe 2019-12-10 22:06:05 +01:00
value-to-json.cc builtins.toJSON: fix __toString usage 2019-10-27 10:15:51 +01:00
value-to-json.hh nix path-info: Add --json flag 2016-08-29 17:29:24 +02:00
value-to-xml.cc OCD performance fix: {find,count}+insert => insert 2019-10-09 16:06:29 +02:00
value-to-xml.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
value.hh Merge remote-tracking branch 'origin/master' into flakes 2019-12-04 00:31:09 +01:00