Add disable spotlight

This commit is contained in:
Yan Lin 2025-08-23 22:06:30 +08:00
parent d1e8fe0a0a
commit f7a36ce662
2 changed files with 34 additions and 0 deletions

View file

@ -328,6 +328,30 @@ Customizes macOS menu bar item spacing for a cleaner look, especially useful on
This configuration runs during system activation to apply menu bar spacing preferences without requiring manual `defaults` commands.
#### Spotlight Indexing (Disabled)
Spotlight indexing is completely disabled in this configuration to:
- Reduce CPU usage and battery drain
- Free up disk space (index can be several GB)
- Prevent unwanted file scanning
**⚠️ Warning**: Disabling Spotlight affects:
- Mail.app search functionality
- Time Machine file restoration interface
- App Store search
- Some third-party apps that rely on Spotlight
**Management Commands**:
```bash
# Check Spotlight status
sudo mdutil -a -s
# Re-enable Spotlight if needed
sudo mdutil -a -i on
# Rebuild index after re-enabling
sudo mdutil -E /
```
## 🔐 SSH Configuration
**Configuration**: `modules/ssh.nix`

View file

@ -12,5 +12,15 @@
echo "Setting menu bar spacing preferences..."
sudo -u yanlin defaults -currentHost write -globalDomain NSStatusItemSpacing -int 10
sudo -u yanlin defaults -currentHost write -globalDomain NSStatusItemSelectionPadding -int 5
echo "Disabling Spotlight indexing..."
# Disable Spotlight indexing for all volumes
# WARNING: This will break Mail.app search, Time Machine, and other features
# To re-enable: sudo mdutil -a -i on
sudo mdutil -a -i off
# Erase existing Spotlight index to free up disk space
echo "Erasing existing Spotlight index..."
sudo mdutil -E /
'';
}