How to move nix store to external drive on macos?

While I haven’t tried it myself, IIUC a symlinked store can cause problems with some software. But the store volume doesn’t have to live on the same drive as /.

If starting over isn’t prohibitive, it’s probably easiest to follow the uninstall instructions (Installing a Binary Distribution - Nix Reference Manual) and then set the appropriate variables to specify a different disk before installing:

If starting over is prohibitive, it’ll be a little more DIY–but there’s inevitably some way to duplicate the existing volume to a new disk and then update /etc/fstab and /Library/LaunchDaemons/org.nixos.darwin-store.plist to specify the new volume’s UUID (fair warning: this will be more complicated if you’re using FileVault).

1 Like