Can I run `nix-build` with a custom store?

I’m running NixOS. Is there a way to tell nix-build to build a derivation at somewhere other than /nix/store (e.g. /home/alice/nix/store)?

nix-build ... --store /home/alice/ should do it I believe.

See here for details: nix.conf - Nix Reference Manual

2 Likes