Turn flake inputs into an attrset
Instead of a list, inputs are now an attrset like
inputs = {
nixpkgs.uri = github:NixOS/nixpkgs;
};
If 'uri' is omitted, than the flake is a lookup in the flake registry, e.g.
inputs = {
nixpkgs = {};
};
but in that case, you can also just omit the input altogether and
specify it as an argument to the 'outputs' function, as in
outputs = { self, nixpkgs }: ...
This also gets rid of 'nonFlakeInputs', which are now just a special
kind of input that have a 'flake = false' attribute, e.g.
inputs = {
someRepo = {
uri = github:example/repo;
flake = false;
};
};
This commit is contained in:
@@ -217,25 +217,20 @@ void makeFlakeClosureGCRoot(Store & store,
|
||||
assert(store.isValidPath(resFlake.flake.sourceInfo.storePath));
|
||||
closure.insert(resFlake.flake.sourceInfo.storePath);
|
||||
|
||||
std::queue<std::reference_wrapper<const flake::FlakeInputs>> queue;
|
||||
std::queue<std::reference_wrapper<const flake::LockedInputs>> queue;
|
||||
queue.push(resFlake.lockFile);
|
||||
|
||||
while (!queue.empty()) {
|
||||
const flake::FlakeInputs & flake = queue.front();
|
||||
const flake::LockedInputs & flake = queue.front();
|
||||
queue.pop();
|
||||
/* Note: due to lazy fetching, these paths might not exist
|
||||
yet. */
|
||||
for (auto & dep : flake.flakeInputs) {
|
||||
for (auto & dep : flake.inputs) {
|
||||
auto path = dep.second.computeStorePath(store);
|
||||
if (store.isValidPath(path))
|
||||
closure.insert(path);
|
||||
queue.push(dep.second);
|
||||
}
|
||||
for (auto & dep : flake.nonFlakeInputs) {
|
||||
auto path = dep.second.computeStorePath(store);
|
||||
if (store.isValidPath(path))
|
||||
closure.insert(path);
|
||||
}
|
||||
}
|
||||
|
||||
if (closure.empty()) return;
|
||||
|
||||
Reference in New Issue
Block a user