# How to: Recover the Nix Store volume from a Time Machine backup on macOS When using Time Machine, the "Nix Store" volume will be backed-up just as the Recovery volume, but it won't be restored when restoring a Time Machine Backup in macOS Recovery. However, we can still manually restore the Nix Store volume from a Time Machine backup in macOS by using `rsync` or `tmutil restore`. ![](https://i.imgur.com/snHtZGb.png) First of all, you'll need to create the Nix Store volume and mount it to `/nix` if it isn't ready. On the commands below, we're using the `create-darwin-volume.sh` script taken from an PR to let nix installation support macOS 10.15, you can use whatever method suitable under the current era that does the same thing. Just note that it's not needed to do a multi-user Nix installation, if you've done it before in the system, again: ```sh # Create a volume for the nix store and configure it to mount at /nix. wget https://raw.githubusercontent.com/LnL7/nix/darwin-10.15-install/scripts/create-darwin-volume.sh bash create-darwin-volume.sh # The following options can be enabled to disable spotlight indexing of the volume, which might be desirable. sudo mdutil -i off /nix # Hides the "Nix Store" disk on Desktop, need to relaunch Finder to see effect. sudo SetFile -a V /nix ``` Then, we can use `rsync` to restore the Nix Store from our Time Machine backup. We're not using `tmutil restore` here because `tmutil restore` can't only restore the content within a directory to a specific destination, and will not show the progress while restoring. Note the trailing slash (`/`) after `Latest/Nix\ Store `, and we're using `-p` (`--perms`) which restore the file permissions, and `-H` (`--hard-links`) which respect the hard link structure. You can use `--dry-run -vP` first to see what will be transferred: ```sh sudo rsync -azpHt '/Volumes/[YourDriveHere]/Backups.backupdb/[YourComputerNameHere]/Latest/Nix Store/' '/nix' ``` If you're using a more recent version of `rsync`, say installed from Homebrew, you might want to add `--info=progress2` to see a progress bar while transferring files: `sudo rsync -azpHt [...] --info=progress2`. ![](https://i.imgur.com/rJQYSeD.jpg) To verify the restore, start a new terminal session and type `which nix`, you should see the correct output. ![](https://i.imgur.com/gmgu0og.png) Then, start the `nix-daemon` manually: ```sh sudo nix-daemon ``` Open another terminal session, then type: ```sh nix-shell -p nix-info --run "nix-info -m" --show-trace ``` You should see the correct output. ![](https://i.imgur.com/N8WfyOC.jpg) `nix-daemon` should be started correctly with `launchctl` on the next reboot, or you can start it directly by using `sudo launchctl kickstart -k system/org.nixos.nix-daemon`. > 💡 You might want to start a fresh new Time Machine backup, by moving the original backup directory in `Backups.backupdb` to another place, after recovering.