Exclude Nix Store from Time Machine Backup

Is there a way to exclude the Nix Store on a Mac (Big Sur) from the Time Machine Backup?
I cant add the Volume to the list of exluded items in the Time Machine Options.

1 Like

I ran into the same problem. My solution was to use the way more flexible tmutil to exclude the nix store rather than the GUI in Settings. tmutil can be used to manage Time Machine from the command line. In this case we use -v to exclude the volume at /nix.

sudo tmutil addexclusion -v /nix

Do note that this requires your terminal emulator to have ‘full disk access’. Don’t worry, tmutil should give instructions on how to enable full disk acces if it isn’t already. Otherwise follow this guide.

It appears to work fine. Testing a few paths with the following command shows that the nix store is indeed excluded from backups.

anon$ tmutil isexcluded ~ /nix /nix/store/…-coreutils-9.1.drv
[Included]    /System/Volumes/Data/Users/anon
[Excluded]    /nix
[Excluded]    /nix/store/…-coreutils-9.1.drv
2 Likes