Skip to content
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

question: "mirror mode" #54

Open
caarlos0 opened this issue Dec 18, 2023 · 2 comments
Open

question: "mirror mode" #54

caarlos0 opened this issue Dec 18, 2023 · 2 comments

Comments

@caarlos0
Copy link

A couple of days ago I decided to try and run a binary cache on my local network to understand better how it works.

Per my understanding, nix-serve will only serve files already on the nix store of the machine that's running it, is that correct?

Is it possible to make it so that, if any machine requests it, it tries to get it from another cache? (act like a mirror)

Or, for things like nixos-rebuild to publish the newly installed packages there automatically?

Thank you!

PS: I'm fairly new to nix

@caarlos0 caarlos0 changed the title question question: "mirror mode" Dec 18, 2023
@SuperSandro2000
Copy link
Contributor

Per my understanding, nix-serve will only serve files already on the nix store of the machine that's running it, is that correct?

yes

Is it possible to make it so that, if any machine requests it, it tries to get it from another cache? (act like a mirror)

I don't think that feature exists currently

Or, for things like nixos-rebuild to publish the newly installed packages there automatically?

You can copy the build system afterwards to the cache with the help of a thin wrapper.

@caarlos0
Copy link
Author

for anyone else trying to achieve this, I ended up doing the following:

the only issue I had is that I the user that runs the ssh command is root, so I had to create a public key for it and add it to the cache's authorized keys file. Is there a better way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants