I have a USB disk with a nix store (to be more precise, the nix-store.squashfs file from the NixOS installation ISO) mounted at /mnt/foobar. So that when I do ls /mnt/foobar
, I see the familiar subdirs, looking like:
kipnv4i3njqc3hjunp8nv23o2io3-somepackage-0.0.1
...etc...etc...
Now, (how) can I import stuff from that nix store into my regular /nix/store? (Ideally, with dependencies...) Or is this impossible?... :/ feels so close, but I really don't know what to do next... :( Tried e.g. NIX_STORE=/mnt/foobar nix-store -qR /mnt/foobar/*-somepackage-*
but I'm getting an error. I'm afraid to just copy dirs between stores, because I don't know if that won't break something; also, no idea how to find out the dependencies then...
cp -i
just to have that extra level of protection in case something does exist and you don't want to overwrite it. This does sound like it could get kind of dangerous, though. Make sure you have a backup in place before attempting this. If it's a VM, just take a snapshot.cp
calls.