2023-12-18 13:14:42 -08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "source-path.hh"
|
|
|
|
#include "store-api.hh"
|
|
|
|
#include "file-system.hh"
|
|
|
|
#include "repair-flag.hh"
|
|
|
|
#include "file-content-address.hh"
|
|
|
|
|
|
|
|
namespace nix {
|
|
|
|
|
2024-02-20 10:36:36 +01:00
|
|
|
enum struct FetchMode { DryRun, Copy };
|
|
|
|
|
2023-12-18 13:14:42 -08:00
|
|
|
/**
|
|
|
|
* Copy the `path` to the Nix store.
|
|
|
|
*/
|
|
|
|
StorePath fetchToStore(
|
|
|
|
Store & store,
|
|
|
|
const SourcePath & path,
|
2024-02-20 10:36:36 +01:00
|
|
|
FetchMode mode,
|
2023-12-18 13:14:42 -08:00
|
|
|
std::string_view name = "source",
|
2024-05-16 19:08:28 -04:00
|
|
|
ContentAddressMethod method = ContentAddressMethod::Raw::NixArchive,
|
2023-12-18 13:14:42 -08:00
|
|
|
PathFilter * filter = nullptr,
|
|
|
|
RepairFlag repair = NoRepair);
|
|
|
|
|
|
|
|
}
|