Nix using store in /var, bind mount?

I have a server where I have enough space available on /var, but not on the root filesystem, and I want to install Nix on that machine. Can I just install it, then move /nix to /var/nix-store and then bind-mount /var/nix-store to /nix?

yes you can, the same way iso uses ro-store and rw-store in overlayfs

1 Like

I tried this, and now Iā€™m getting:

error: cannot connect to socket at '/nix/var/nix/daemon-socket/socket': Connection refused.

Did I do anything wrong? I did mv /nix /var/nix and then bind-mounted /var/nix to /nix (and restarted nix-daemon).

Hosted by Flying Circus.