1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-01 12:37:59 +02:00

Remove 'name' attribute from flakes

This is no longer needed since flakes are given an identity in the
'inputs' attribute.
This commit is contained in:
Eelco Dolstra 2019-08-30 16:38:27 +02:00
parent 30ccf4e52d
commit 80c36d4562
6 changed files with 6 additions and 41 deletions

View file

@ -239,11 +239,6 @@ Flake getFlake(EvalState & state, const FlakeRef & flakeRef)
} else
throw Error("flake '%s' lacks attribute 'edition'", flakeRef);
if (auto name = vInfo.attrs->get(state.sName))
flake.id = state.forceStringNoCtx(*(**name).value, *(**name).pos);
else
throw Error("flake '%s' lacks attribute 'name'", flakeRef);
if (auto description = vInfo.attrs->get(state.sDescription))
flake.description = state.forceStringNoCtx(*(**description).value, *(**description).pos);
@ -292,7 +287,6 @@ Flake getFlake(EvalState & state, const FlakeRef & flakeRef)
for (auto & attr : *vInfo.attrs) {
if (attr.name != sEdition &&
attr.name != sEpoch &&
attr.name != state.sName &&
attr.name != state.sDescription &&
attr.name != sInputs &&
attr.name != sOutputs)

View file

@ -67,7 +67,6 @@ struct FlakeInput
struct Flake
{
FlakeId id;
FlakeRef originalRef;
std::string description;
SourceInfo sourceInfo;

View file

@ -103,7 +103,6 @@ static void sourceInfoToJson(const SourceInfo & sourceInfo, nlohmann::json & j)
static void printFlakeInfo(const Flake & flake)
{
std::cout << fmt("ID: %s\n", flake.id);
std::cout << fmt("Description: %s\n", flake.description);
std::cout << fmt("Edition: %s\n", flake.edition);
printSourceInfo(flake.sourceInfo);
@ -112,7 +111,6 @@ static void printFlakeInfo(const Flake & flake)
static nlohmann::json flakeToJson(const Flake & flake)
{
nlohmann::json j;
j["id"] = flake.id;
j["description"] = flake.description;
j["edition"] = flake.edition;
sourceInfoToJson(flake.sourceInfo, j);
@ -120,12 +118,6 @@ static nlohmann::json flakeToJson(const Flake & flake)
}
#if 0
static void printNonFlakeInfo(const NonFlake & nonFlake)
{
std::cout << fmt("ID: %s\n", nonFlake.alias);
printSourceInfo(nonFlake.sourceInfo);
}
// FIXME: merge info CmdFlakeInfo?
struct CmdFlakeDeps : FlakeCommand
{
@ -148,9 +140,6 @@ struct CmdFlakeDeps : FlakeCommand
auto resFlake = std::move(todo.front());
todo.pop();
for (auto & nonFlake : resFlake.nonFlakeDeps)
printNonFlakeInfo(nonFlake);
for (auto & info : resFlake.flakeDeps) {
printFlakeInfo(info.second.flake);
todo.push(info.second);