Skip to content

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.

6 options 4 verified against System Settings

System Settings › Notifications › Application Notifications

home-manager · per user Not verified Restarts usernoted
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.usernoted apps

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 || true

For 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 || true

System Settings › Notifications › Show previews

home-manager · per user ✓ Verified on macOS 27 Restarts usernoted
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.usernoted content_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 || true

For 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 || true

For 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 || true

For 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 || true

System Settings › Notifications › Summarize notifications

home-manager · per user Not verified Restarts usernoted
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.usernoted summarize_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 || true

For 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 || true

For 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 || true

System Settings › Notifications › Allow notifications › When mirroring or sharing the display

home-manager · per user ✓ Verified on macOS 27 Restarts usernoted
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.usernoted dnd_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 || true

For 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 || true

System Settings › Notifications › Allow notifications › When the display is sleeping

home-manager · per user ✓ Verified on macOS 27 Restarts usernoted
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.usernoted dnd_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 || true

For 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 || true

System Settings › Notifications › Allow notifications › When the screen is locked

home-manager · per user ✓ Verified on macOS 27 Restarts usernoted
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.usernoted dnd_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 || true

For 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