Testing desktop notifications with NixOS

Desktop notifications are a nice way to be informed immediately about important changes on your system. In a terminal or interactive shell script this is easy enough: trap 'notify-send "💥"' ERR. But in a non-interactive or restricted context, such as a systemd service, we need more setup for desktop notifications to work. And with more setup comes more chances to mess up, so it would be good to…