-
-
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
nix copy
support to exclude paths which are already in cache.nixos.org
#7527
Comments
Essentially you are asking to substitute paths from cache.nixos.org instead of copying them? |
I have tested that
can install and boot the entire system with no errors |
implemented https://github.com/zhaofengli/attic |
I'd love this to be implemented in Nix natively... |
Is your feature request related to a problem? Please describe.
Currently,
nix copy
will copy whole closure. For many users who self-host cache server, it is unnecessary to upload paths that have been cached incache.nixos.org
to a self-host server. This default behavior wastes time and storage, especially whennix copy
anixosConfiguration
to self-host cache server.Describe the solution you'd like
I use
traefik
to reverse proxyminio
server. Therefore, I make a router rule which will forwardGET http://MYHOST/BUCKET/HASH.narinfo
to a proxy server as a workaround. This proxy will GET http://cache.nixos.org/HASH.narinfo first. If status code is 200(already in official cache), it just pipescache.nixos.org
response to client so thatnix copy
will not upload this path. If status code is 404, it pipesMYHOST
response to client.Test Result
nix copy
whole closureFull log: https://github.com/mlyxshi/flake/actions/runs/3798651110/jobs/6460501893
Time: 16min 58s
Storage: 383.5MiB
nix copy
exclude paths which are already incache.nixos.org
Full log: https://github.com/mlyxshi/flake/actions/runs/3798783525/jobs/6460750038
Time: 27s
Storage: 23.6MiB
All in all,
nix copy
add a flag that supports to exclude paths already incache.nixos.org
will benefit a lot for self-hosted users. Although, I have found a workaround, It would be more convenient to have official support and the implementation is not complexDescribe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: