I recently switched to a new apple silicon Macbook Pro on Monterey and i can’t seem to get spotlight to index my ‘Nix Store’ apfs volume (It’s using the default settings, in my Macintosh HD Volume Group as an AFPS Volume).
I don’t remember having problems before. My major issue i’m running into without spotlight indexing is that i can’t locate applications i install (e.g. Emacs.app) without taking special precautions like making an explicit alias.
I have tried completely wiping the volume, completely wiping spotlight index with mdutil -aE && mdutil -ai off && mdutil -ai on, rebooting and reinstalling nix from scratch. Can’t seem to get indexing to go no matter what i do.
Some of the interface stuff seems buggy on the macOS side, but I can’t say I’m terribly surprised and the underlying behavior is expected. (I guess it’s currently collateral damage in an effort to keep spotlight from blowing resources indexing the whole nix store, which is broadly not what people want.)
In any case, spotlight should start indexing it if you remove nobrowse from /etc/fstab (you’ll need to do this with sudo vifs). I’m not sure if this will be the behavior you want. In my recollection, there was a lot of misinformation/superstition around spotlight/mdutil when I looked into this (I don’t think I ever found official documentation confirming that nobrowse disables it, for example).
It’d be good to be able to have our cake and eat it too, if you know much about spotlight or at least have a little time to give it a vigorous shake.