NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.64k stars 1.51k forks source link

Run Nix worker in slave mode #139

Open rickynils opened 11 years ago

rickynils commented 11 years ago

It would be nice if you could run the Nix worker daemon in slave mode on computer A, where it would delegate all Nix operations to the Nix worker running on another computer B. The Nix store (and maybe the database too) from B should be mounted read-only with NFS, CIFS or VIRTFS/9P on computer A, and no copying of paths should take place.

You can do this today, by just mounting the store from computer B on computer A and then perform all Nix builds on computer B (or even do a hack with socat that tunnels all Nix socket operations from A to B). However, then you can't use nix-build, nix-env or nixos-rebuild properly on computer A. I imagine a Nix slave mode could solve this quite easily.

The use case is to be able to share a Nix store between several computers (saving disk space and keep mutable parts down), but still be able to "local" builds. It is also very useful for virtual machines, where it is particularly nice to share the Nix store with the host instead of filling up disk images.

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

Ericson2314 commented 3 years ago

We have NIX_REMOTE=ssh-ng://... for just setting a remote store as the default. I would say the remote store mounting part is quite unrelated to that?

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

rickynils commented 1 year ago

I think that https://github.com/NixOS/nix/issues/7890 (which is being implemented by @mupdt) would more or less fulfill the use case described in this issue. So this 10 year old issue can probably be closed.