aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers/tarball.cc
AgeCommit message (Collapse)Author
2020-06-12Merge pull request #3674 from matthewbauer/allow-empty-hash2Eelco Dolstra
Allow empty hash in derivations
2020-06-12Add newHashAllowEmpty helper functionMatthew Bauer
This replaces the copy&paste with a helper function in hash.hh.
2020-06-09Support empty hash in fetchersMatthew Bauer
fetchTarball, fetchTree, and fetchGit all have *optional* hash attrs. This means that we need to be careful with what we allow to avoid accidentally making these defaults. When ‘hash = ""’ we assume the empty hash is wanted.
2020-06-03libutils/hash: remove default encodingzimbatm
This will make it easier to reason about the hash encoding and switch to SRI everywhere where possible.
2020-05-29Remove addToStore variant as requested by `FIXME`John Ericson
The idea is it's always more flexible to consumer a `Source` than a plain string, and it might even reduce memory consumption. I also looked at `addToStoreFromDump` with its `// FIXME: remove?`, but the worked needed for that is far more up for interpretation, so I punted for now.
2020-05-26Change remaining bools with FileIngestionMethodCarlo Nucera
2020-04-08after flake rebaseNikola Knezevic
2020-04-07Respect the narHash attribute in more input typesEelco Dolstra
(cherry picked from commit a6ff66b658b61aef80d936f0183447fe4cb46000)
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).