aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/flake/lockfile.cc
AgeCommit message (Collapse)Author
2024-03-04Merge pull request #10055 from GrahamDennis/gdennis/faster-flake-lock-parsingeldritch horrors
Faster flake.lock parsing (cherry picked from commit ff4fa4dbd307fb155155421a7ec0625383dcedeb) Change-Id: I34325834770db66fa56f0d8d02d3d2322dea3c65
2023-08-14Fix follow path checking at depths greater than 2Alex Zero
We need to recurse into the input tree to handle follows paths that trarverse multiple inputs that may or may not be follow paths themselves.
2023-04-05Explicitely define `LockFile::operator!=`Théophane Hufschmitt
It should be syntethised in terms of `operator==`, but the GCC version used on aarch64-linux doesn't implement that (see https://hydra.nixos.org/build/214848896=. So explicitely define it. Fix https://github.com/NixOS/nix/issues/8159
2023-02-01Fix clang compilationEelco Dolstra
2022-12-07Trivial changes from the lazy-trees branchEelco Dolstra
2022-09-06lockfile -> lock file for consistencyEelco Dolstra
2022-09-01Revert "Merge pull request #6621 from Kha/nested-follows"Eelco Dolstra
This reverts commit c530cda345377370c52a616d608de88b9d67cd40, reversing changes made to 4adcdff5c1d5f9f135c4ec61d690890443c19e6a.
2022-08-28Fix overlapping flake followsSebastian Ullrich
2022-02-24libfetchers: Rename immutable -> lockedEelco Dolstra
This is more consistent with flake terminology.
2021-08-11In flake lock file diffs, show the last-modified date of inputs if availableEelco Dolstra
This is a bit more informative than just the hash. Also, format the diffs a bit nicer.
2020-11-19Fix assertion failure in LockFile::LockFile()Eelco Dolstra
Fixes #4241.
2020-10-28Capitalize JSON for consistencyMatthew Kenigsberg
2020-10-26Move ExplicitEelco Dolstra
2020-10-06Remove 'using namespace fetchers'Eelco Dolstra
2020-09-21Don't include <regex> in header filesEelco Dolstra
This reduces compilation time by ~15 seconds (CPU time). Issue #4045.
2020-06-12Check 'follows' inputsEelco Dolstra
2020-06-11diffLockFiles(): Show 'follows' changesEelco Dolstra
2020-06-11Represent 'follows' inputs explicitly in the lock fileEelco Dolstra
This fixes an issue where lockfile generation was not idempotent: after updating a lockfile, a "follows" node would end up pointing to a new copy of the node, rather than to the original node.
2020-06-10Add helper function printInputPath()Eelco Dolstra
2020-06-08Add completion for --update-inputEelco Dolstra
2020-06-05diffLockFiles(): Fix assertion failureEelco Dolstra
There are some cases where this inequality didn't hold, in particular due to the Input / TreeInfo merge, where we're not always showing narHash.
2020-05-30Remove TreeInfoEelco Dolstra
The attributes previously stored in TreeInfo (narHash, revCount, lastModified) are now stored in Input. This makes it less arbitrary what attributes are stored where. As a result, the lock file format has changed. An entry like "info": { "lastModified": 1585405475, "narHash": "sha256-bESW0n4KgPmZ0luxvwJ+UyATrC6iIltVCsGdLiphVeE=" }, "locked": { "owner": "NixOS", "repo": "nixpkgs", "rev": "b88ff468e9850410070d4e0ccd68c7011f15b2be", "type": "github" }, is now stored as "locked": { "owner": "NixOS", "repo": "nixpkgs", "rev": "b88ff468e9850410070d4e0ccd68c7011f15b2be", "type": "github", "lastModified": 1585405475, "narHash": "sha256-bESW0n4KgPmZ0luxvwJ+UyATrC6iIltVCsGdLiphVeE=" }, The 'Input' class is now a dumb set of attributes. All the fetcher implementations subclass InputScheme, not Input. This simplifies the API. Also, fix substitution of flake inputs. This was broken since lazy flake fetching started using fetchTree internally.
2020-05-06Remove support for old lockfiles and the epoch/uri attributesEelco Dolstra
2020-04-02Move parseTreeInfo()Eelco Dolstra
2020-04-02nix flake info --json: Show TreeInfoEelco Dolstra
2020-03-30Move fetchers from libstore to libfetchersEelco Dolstra
2020-03-27Fix diffLockFiles()Eelco Dolstra
2020-03-12Change the lock file to a graphEelco Dolstra
This enables support for cycles between flakes.
2020-03-09Move calling flakes into a Nix helper function (call-flake.nix)Eelco Dolstra
2020-03-09Add 'flake' attribute to lock files to denote non-flakesEelco Dolstra
2020-02-06Registry: Use attr notation instead of URLsEelco Dolstra
2020-02-02Add TreeInfo::computeStorePath()Eelco Dolstra
2020-02-02CleanupEelco Dolstra
2020-02-02Renamed ref / resolvedRef -> lockedRefEelco Dolstra
2020-02-01Remove superfluous TreeInfo::rev fieldEelco Dolstra
2020-02-01Record TreeInfo in the lock fileEelco Dolstra
Necessary for #3253.
2020-01-31Change lock file format to use an attribute representation of flake refs ↵Eelco Dolstra
rather than URLs
2020-01-30Check LockedInput::computeStorePath()Eelco Dolstra
2020-01-29Add --update-input flag to update a specific flake inputEelco Dolstra
Typical usage: $ nix flake update ~/Misc/eelco-configurations/hagbard --update-input nixpkgs to update the 'nixpkgs' input of a flake while leaving every other input unchanged. The argument is an input path, so you can do e.g. '--update-input dwarffs/nixpkgs' to update an input of an input. Fixes #2928.
2020-01-29Add flag --override-input to override specific lock file entriesEelco Dolstra
E.g. $ nix flake update ~/Misc/eelco-configurations/hagbard \ --override-input 'dwarffs/nixpkgs' ../my-nixpkgs overrides the 'nixpkgs' input of the 'dwarffs' input of the top-level flake. Fixes #2837.
2020-01-24Respect lock files of inputs + fine-grained lock file controlEelco Dolstra
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-21Pluggable fetchersEelco Dolstra
Flakes are now fetched using an extensible mechanism. Also lots of other flake cleanups.
2019-12-11Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2019-10-21Use upstream json_fwd.hpp to speed up compilationEelco Dolstra
2019-10-08uri -> url for consistencyEelco Dolstra
2019-09-18Record original flakerefs in the lock file againEelco Dolstra
If 'input.<name>.uri' changes, then the entry in the lockfile for input <name> should be considered stale. Also print some messages when lock file entries are added/updated.
2019-08-30Turn flake inputs into an attrsetEelco Dolstra
Instead of a list, inputs are now an attrset like inputs = { nixpkgs.uri = github:NixOS/nixpkgs; }; If 'uri' is omitted, than the flake is a lookup in the flake registry, e.g. inputs = { nixpkgs = {}; }; but in that case, you can also just omit the input altogether and specify it as an argument to the 'outputs' function, as in outputs = { self, nixpkgs }: ... This also gets rid of 'nonFlakeInputs', which are now just a special kind of input that have a 'flake = false' attribute, e.g. inputs = { someRepo = { uri = github:example/repo; flake = false; }; };
2019-07-12Don't write lock files if they have dirty inputsEelco Dolstra
2019-06-05Move flake-related stuff to src/libexpr/flakeEelco Dolstra