diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-04-02 14:56:20 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-04-07 09:08:51 +0200 |
commit | 670feb000a9fac76f0996711f061ec466a53dc97 (patch) | |
tree | 66090a92aab3db8a3d813a32f215f0f0b7c3348a /src/libfetchers/attrs.hh | |
parent | 462421d34588c227eb736b07f7b40a38aa0972a6 (diff) |
Add 'path' fetcher
This fetchers copies a plain directory (i.e. not a Git/Mercurial
repository) to the store (or does nothing if the path is already a
store path).
One use case is to pin the 'nixpkgs' flake used to build the current
NixOS system, and prevent it from being garbage-collected, via a
system registry entry like this:
{
"from": {
"id": "nixpkgs",
"type": "indirect"
},
"to": {
"type": "path",
"path": "/nix/store/rralhl3wj4rdwzjn16g7d93mibvlr521-source",
"lastModified": 1585388205,
"rev": "b0c285807d6a9f1b7562ec417c24fa1a30ecc31a"
},
"exact": true
}
Note the fake "lastModified" and "rev" attributes that ensure that the
flake gives the same evaluation results as the corresponding
Git/GitHub inputs.
(cherry picked from commit 12f9379123eba828f2ae06f7978a37b7045c2b23)
Diffstat (limited to 'src/libfetchers/attrs.hh')
-rw-r--r-- | src/libfetchers/attrs.hh | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libfetchers/attrs.hh b/src/libfetchers/attrs.hh index 2c9e772d2..d6e0ae000 100644 --- a/src/libfetchers/attrs.hh +++ b/src/libfetchers/attrs.hh @@ -34,4 +34,6 @@ std::optional<bool> maybeGetBoolAttr(const Attrs & attrs, const std::string & na bool getBoolAttr(const Attrs & attrs, const std::string & name); +std::map<std::string, std::string> attrsToQuery(const Attrs & attrs); + } |