diff --git a/src/libfetchers/git-utils.cc b/src/libfetchers/git-utils.cc index 32f665aa0..4f034e9d4 100644 --- a/src/libfetchers/git-utils.cc +++ b/src/libfetchers/git-utils.cc @@ -986,4 +986,11 @@ std::vector> GitRepoImpl::getSubmodules return result; } +ref getTarballCache() +{ + static auto repoDir = std::filesystem::path(getCacheDir()) / "nix" / "tarball-cache"; + + return GitRepo::openRepo(repoDir, true, true); +} + } diff --git a/src/libfetchers/git-utils.hh b/src/libfetchers/git-utils.hh index 029d39741..5f68d26a7 100644 --- a/src/libfetchers/git-utils.hh +++ b/src/libfetchers/git-utils.hh @@ -95,4 +95,6 @@ struct GitRepo const std::vector & publicKeys) = 0; }; +ref getTarballCache(); + } diff --git a/src/libfetchers/github.cc b/src/libfetchers/github.cc index 8b3e6ff20..e6fbece13 100644 --- a/src/libfetchers/github.cc +++ b/src/libfetchers/github.cc @@ -10,7 +10,6 @@ #include "tarball.hh" #include "tarfile.hh" #include "git-utils.hh" -#include "tarball-cache.hh" #include #include @@ -193,6 +192,12 @@ struct GitArchiveInputScheme : InputScheme virtual DownloadUrl getDownloadUrl(const Input & input) const = 0; + struct TarballInfo + { + Hash treeHash; + time_t lastModified; + }; + std::pair downloadArchive(ref store, Input input) const { if (!maybeGetStrAttr(input.attrs, "ref")) input.attrs.insert_or_assign("ref", "HEAD"); diff --git a/src/libfetchers/tarball-cache.cc b/src/libfetchers/tarball-cache.cc deleted file mode 100644 index bb2c51973..000000000 --- a/src/libfetchers/tarball-cache.cc +++ /dev/null @@ -1,13 +0,0 @@ -#include "tarball-cache.hh" -#include "users.hh" - -namespace nix::fetchers { - -ref getTarballCache() -{ - static auto repoDir = std::filesystem::path(getCacheDir()) / "nix" / "tarball-cache"; - - return GitRepo::openRepo(repoDir, true, true); -} - -} diff --git a/src/libfetchers/tarball-cache.hh b/src/libfetchers/tarball-cache.hh deleted file mode 100644 index e1517038b..000000000 --- a/src/libfetchers/tarball-cache.hh +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once -///@file - -#include "ref.hh" -#include "git-utils.hh" - -namespace nix::fetchers { - -struct TarballInfo -{ - Hash treeHash; - time_t lastModified; -}; - -ref getTarballCache(); - -}