Notifications
Everything under System Settings › Notifications, as Nix options. Each one is named after the control
you'd click, and set under programs.nix-plist-manager.options in home-manager.
Application Notifications
Section titled “Application Notifications”System Settings › Notifications › Application Notifications
applications.systemSettings.notifications.applications = "/path/to/snapshot"; A directory captured with nix run …#capture — see Snapshots "unset" puts back macOS's default.
Where it's stored and what runs
-
~/Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernotedapps
For /path/to/snapshot:
/usr/bin/defaults delete "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' apps 2>/dev/null || true/usr/bin/defaults import "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' /path/to/snapshot/apps.plist || echo 'nix-plist-manager: failed: /usr/bin/defaults import "$HOME"/'\''Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted'\'' /path/to/snapshot/apps.plist' >&2/usr/bin/killall usernoted 2>/dev/null || trueFor unset:
/usr/bin/defaults delete "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' apps 2>/dev/null || true/usr/bin/killall usernoted 2>/dev/null || trueShow previews
Section titled “Show previews”System Settings › Notifications › Show previews
applications.systemSettings.notifications.notificationCenter.showPreviews = "Always"; One of: "Always""Never""When Unlocked" "unset" puts back macOS's default.
Where it's stored and what runs
-
~/Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernotedcontent_visibility
For Always:
/usr/bin/defaults write "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' content_visibility -int 3 || echo 'nix-plist-manager: failed: /usr/bin/defaults write "$HOME"/'\''Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted'\'' content_visibility -int 3' >&2/usr/bin/killall usernoted 2>/dev/null || trueFor Never:
/usr/bin/defaults write "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' content_visibility -int 1 || echo 'nix-plist-manager: failed: /usr/bin/defaults write "$HOME"/'\''Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted'\'' content_visibility -int 1' >&2/usr/bin/killall usernoted 2>/dev/null || trueFor When Unlocked:
/usr/bin/defaults write "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' content_visibility -int 2 || echo 'nix-plist-manager: failed: /usr/bin/defaults write "$HOME"/'\''Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted'\'' content_visibility -int 2' >&2/usr/bin/killall usernoted 2>/dev/null || trueFor unset:
/usr/bin/defaults delete "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' content_visibility 2>/dev/null || true/usr/bin/killall usernoted 2>/dev/null || trueSummarize notifications
Section titled “Summarize notifications”System Settings › Notifications › Summarize notifications
applications.systemSettings.notifications.notificationCenter.summarizeNotifications = true; true or false "unset" puts back macOS's default.
Where it's stored and what runs
-
~/Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernotedsummarize_previews
For false:
/usr/bin/defaults write "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' summarize_previews -bool false || echo 'nix-plist-manager: failed: /usr/bin/defaults write "$HOME"/'\''Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted'\'' summarize_previews -bool false' >&2/usr/bin/killall usernoted 2>/dev/null || trueFor true:
/usr/bin/defaults write "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' summarize_previews -bool true || echo 'nix-plist-manager: failed: /usr/bin/defaults write "$HOME"/'\''Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted'\'' summarize_previews -bool true' >&2/usr/bin/killall usernoted 2>/dev/null || trueFor unset:
/usr/bin/defaults delete "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' summarize_previews 2>/dev/null || true/usr/bin/killall usernoted 2>/dev/null || trueAllow notifications
Section titled “Allow notifications”When mirroring or sharing the display
Section titled “When mirroring or sharing the display”System Settings › Notifications › Allow notifications › When mirroring or sharing the display
applications.systemSettings.notifications.allowNotifications.whenMirroringOrSharingTheDisplay = "Allow Notifications"; One of: "Allow Notifications""Notifications Off"
Where it's stored and what runs
-
~/Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoteddnd_prefs
For Allow Notifications:
f=$(/usr/bin/mktemp) && /usr/bin/defaults export "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' - | /usr/bin/plutil -extract dnd_prefs raw -o - - | /usr/bin/base64 -D > "$f" && /usr/bin/plutil -replace dndMirrored -bool false "$f" && /usr/bin/defaults write "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' dnd_prefs -data "$(/usr/bin/xxd -p "$f" | /usr/bin/tr -d '\n')" || echo 'nix-plist-manager: failed: setting dndMirrored in dnd_prefs' >&2; /bin/rm -f "$f"/usr/bin/killall usernoted 2>/dev/null || trueFor Notifications Off:
f=$(/usr/bin/mktemp) && /usr/bin/defaults export "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' - | /usr/bin/plutil -extract dnd_prefs raw -o - - | /usr/bin/base64 -D > "$f" && /usr/bin/plutil -replace dndMirrored -bool true "$f" && /usr/bin/defaults write "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' dnd_prefs -data "$(/usr/bin/xxd -p "$f" | /usr/bin/tr -d '\n')" || echo 'nix-plist-manager: failed: setting dndMirrored in dnd_prefs' >&2; /bin/rm -f "$f"/usr/bin/killall usernoted 2>/dev/null || trueWhen the display is sleeping
Section titled “When the display is sleeping”System Settings › Notifications › Allow notifications › When the display is sleeping
applications.systemSettings.notifications.allowNotifications.whenTheDisplayIsSleeping = true; true or false
Where it's stored and what runs
-
~/Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoteddnd_prefs
For false:
f=$(/usr/bin/mktemp) && /usr/bin/defaults export "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' - | /usr/bin/plutil -extract dnd_prefs raw -o - - | /usr/bin/base64 -D > "$f" && /usr/bin/plutil -replace dndDisplaySleep -bool true "$f" && /usr/bin/defaults write "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' dnd_prefs -data "$(/usr/bin/xxd -p "$f" | /usr/bin/tr -d '\n')" || echo 'nix-plist-manager: failed: setting dndDisplaySleep in dnd_prefs' >&2; /bin/rm -f "$f"/usr/bin/killall usernoted 2>/dev/null || trueFor true:
f=$(/usr/bin/mktemp) && /usr/bin/defaults export "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' - | /usr/bin/plutil -extract dnd_prefs raw -o - - | /usr/bin/base64 -D > "$f" && /usr/bin/plutil -replace dndDisplaySleep -bool false "$f" && /usr/bin/defaults write "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' dnd_prefs -data "$(/usr/bin/xxd -p "$f" | /usr/bin/tr -d '\n')" || echo 'nix-plist-manager: failed: setting dndDisplaySleep in dnd_prefs' >&2; /bin/rm -f "$f"/usr/bin/killall usernoted 2>/dev/null || trueWhen the screen is locked
Section titled “When the screen is locked”System Settings › Notifications › Allow notifications › When the screen is locked
applications.systemSettings.notifications.allowNotifications.whenTheScreenIsLocked = true; true or false
Where it's stored and what runs
-
~/Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoteddnd_prefs
For false:
f=$(/usr/bin/mktemp) && /usr/bin/defaults export "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' - | /usr/bin/plutil -extract dnd_prefs raw -o - - | /usr/bin/base64 -D > "$f" && /usr/bin/plutil -replace dndDisplayLock -bool true "$f" && /usr/bin/defaults write "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' dnd_prefs -data "$(/usr/bin/xxd -p "$f" | /usr/bin/tr -d '\n')" || echo 'nix-plist-manager: failed: setting dndDisplayLock in dnd_prefs' >&2; /bin/rm -f "$f"/usr/bin/killall usernoted 2>/dev/null || trueFor true:
f=$(/usr/bin/mktemp) && /usr/bin/defaults export "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' - | /usr/bin/plutil -extract dnd_prefs raw -o - - | /usr/bin/base64 -D > "$f" && /usr/bin/plutil -replace dndDisplayLock -bool false "$f" && /usr/bin/defaults write "$HOME"/'Library/Group Containers/group.com.apple.usernoted/Library/Preferences/group.com.apple.usernoted' dnd_prefs -data "$(/usr/bin/xxd -p "$f" | /usr/bin/tr -d '\n')" || echo 'nix-plist-manager: failed: setting dndDisplayLock in dnd_prefs' >&2; /bin/rm -f "$f"/usr/bin/killall usernoted 2>/dev/null || true