mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-23 06:26:15 +02:00
Doh
This commit is contained in:
parent
021634e3e3
commit
00e1400eb7
1 changed files with 26 additions and 0 deletions
26
src/libfetchers/tree-info.cc
Normal file
26
src/libfetchers/tree-info.cc
Normal file
|
@ -0,0 +1,26 @@
|
|||
#include "tree-info.hh"
|
||||
#include "store-api.hh"
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace nix::fetchers {
|
||||
|
||||
StorePath TreeInfo::computeStorePath(Store & store) const
|
||||
{
|
||||
assert(narHash);
|
||||
return store.makeFixedOutputPath(true, narHash, "source");
|
||||
}
|
||||
|
||||
nlohmann::json TreeInfo::toJson() const
|
||||
{
|
||||
nlohmann::json json;
|
||||
assert(narHash);
|
||||
json["narHash"] = narHash.to_string(SRI);
|
||||
if (revCount)
|
||||
json["revCount"] = *revCount;
|
||||
if (lastModified)
|
||||
json["lastModified"] = *lastModified;
|
||||
return json;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue