aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers
AgeCommit message (Collapse)Author
2020-05-29Factor out GitHub / GitLab commonalityEelco Dolstra
2020-05-28add gitlab libfetcherFinn Behrens
2020-05-13Update src/libfetchers/git.ccEelco Dolstra
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2020-05-10SimplifyEelco Dolstra
2020-04-27Improve path:// handlingEelco Dolstra
In particular, doing 'nix build /path/to/dir' now works if /path/to/dir is not a Git tree (it only has to contain a flake.nix file). Also, 'nix flake init' no longer requires a Git tree (but it will do a 'git add flake.nix' if it's a Git tree)
2020-04-22Path fetcher: Fix store path nameEelco Dolstra
2020-04-14Make Registry::read() more robustEelco Dolstra
2020-04-09Fix buildEelco Dolstra
2020-04-09Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-04-08after flake rebaseNikola Knezevic
2020-04-07Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2020-04-07Merge branch 'fetchgit-recursive' of https://github.com/blitz/nixEelco Dolstra
2020-04-07Add FIXMEEelco Dolstra
(cherry picked from commit 2f494531b7811b45f6b76787f225495a14d28a7f)
2020-04-07PathInput: Add some methodsEelco Dolstra
(cherry picked from commit 78ad5b3d91507427fa563f3474dc52da608ad224)
2020-04-07Respect the narHash attribute in more input typesEelco Dolstra
(cherry picked from commit a6ff66b658b61aef80d936f0183447fe4cb46000)
2020-04-07Add 'path' fetcherEelco Dolstra
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)
2020-04-07Backport libfetchers from the flakes branchEelco Dolstra
This provides a pluggable mechanism for defining new fetchers. It adds a builtin function 'fetchTree' that generalizes existing fetchers like 'fetchGit', 'fetchMercurial' and 'fetchTarball'. 'fetchTree' takes a set of attributes, e.g. fetchTree { type = "git"; url = "https://example.org/repo.git"; ref = "some-branch"; rev = "abcdef..."; } The existing fetchers are just wrappers around this. Note that the input attributes to fetchTree are the same as flake input specifications and flake lock file entries. All fetchers share a common cache stored in ~/.cache/nix/fetcher-cache-v1.sqlite. This replaces the ad hoc caching mechanisms in fetchGit and download.cc (e.g. ~/.cache/nix/{tarballs,git-revs*}). This also adds support for Git worktrees (c169ea59049f861aaba429f48b828d0820b74d1d).
2020-04-02Don't barf on registry parse errorsEelco Dolstra
2020-04-02Respect the narHash attribute in more input typesEelco Dolstra
call-flake.nix now passes node.info.narHash to fetchTree. This ensures that dirty Git trees work even in pure mode.
2020-04-02PathInput: Add some methodsEelco Dolstra
2020-04-02Move parseTreeInfo()Eelco Dolstra
2020-04-02Add 'path' fetcherEelco Dolstra
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.
2020-04-02DohEelco Dolstra
2020-04-02nix flake info --json: Show TreeInfoEelco Dolstra
2020-04-01Support registry entries that must match exactlyEelco Dolstra
An example use is for pinning the "nixpkgs" entry the system-wide registry to a particular store path. Inexact matches (e.g. "nixpkgs/master") should still use the global registry.
2020-04-01Registry: Use a struct instead of a tuple for entriesEelco Dolstra
2020-04-01Add a system-wide flake registry /etc/nix/registry.jsonEelco Dolstra
One application for this is pinning the 'nixpkgs' flake to the exact revision used to build the NixOS system, e.g. { "flakes": [ { "from": { "id": "nixpkgs", "type": "indirect" }, "to": { "owner": "NixOS", "repo": "nixpkgs", "type": "github", "rev": "b0c285807d6a9f1b7562ec417c24fa1a30ecc31a" } } ], "version": 2 }
2020-03-30Remove global -I flagsEelco Dolstra
2020-03-30Move fetchers from libstore to libfetchersEelco Dolstra