-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add nix query-substituters command #4733
Conversation
When no attr path is specified (like when using -f ... arg), findAlongAttrPath will not autocall the expression. This is needed when you have a .nix file that has arguments. This should make searches like: $ nix search -f ... work correctly.
nix weather is used to figure out how much of a flake's packages are in a substituter. This allows us to get an idea for how much we'll have to build locally. It can be used with Nixpkgs, but also individual projects to determine objectively how much is missing from the cache. Example usage is: $ nix weather nixpkgs --substituters https://cache.nixos.org Note that this is using derivations instead of output paths to determine what depends on each path. This is necessary since we don't know what dependencies a given store path will have unless it's built. /cc @edolstra @domenkozar @vcunat @masaeedu Fixes NixOS#3752
I wonder if this should respect |
also multiple installables
Yeah that sounds good. I've updated with a check for that. |
What does "weather" mean in this context? I have trouble connecting it with what the command does. |
src/nix/weather.cc
Outdated
uint64_t narSize = 0; | ||
std::optional<uint64_t> downloadSize = 0; | ||
|
||
for (auto & path : validPaths) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very sequential so it will be latency-bound. Maybe you can use queryMissing
instead? It should be a lot faster. Or use the async version of queryPathInfo
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
queryValidPaths should populate the cache up front. These queryPathInfo should be just cache lookups. I supposed some caches may not have cached backing them up? In that case, it would be very slow.
The naming How about |
Could this also get a machine readable output so we can script around it? |
I marked this as stale due to inactivity. → More info |
nix query-substituters is used to figure out how much of a flake's packages are
in a substituter. This allows us to get an idea for how much we'll
have to build locally. It can be used with Nixpkgs, but also
individual projects to determine objectively how much is missing from
the cache.
Example usage is:
$ nix query-substituters nixpkgs --substituters https://cache.nixos.org
Note that this is using derivations instead of output paths to
determine what depends on each path. This is necessary since we don't
know what dependencies a given store path will have unless it's built.
/cc @edolstra @domenkozar @vcunat @masaeedu
Fixes #3752