fix(systemdNotify): fix libnotify implementation
This commit is contained in:
parent
2dcb901ae1
commit
05b3c065f5
1 changed files with 3 additions and 4 deletions
|
@ -91,13 +91,12 @@ in
|
|||
// optionalAttrs (cfg.method == "libnotify") {
|
||||
description = "Desktop notifications for %i service failure";
|
||||
environment = {
|
||||
DBUS_SESSION_BUS_ADDRESS = "unix:path=/run/user/${
|
||||
toString config.users.users.${cfg.libnotify.user}.uid
|
||||
}/bus";
|
||||
DISPLAY = ":0";
|
||||
INSTANCE = "%i";
|
||||
};
|
||||
script = ''
|
||||
${pkgs.libnotify}/bin/notify-send --urgency=critical \
|
||||
export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(id -u '${cfg.libnotify.user}')/bus"
|
||||
${pkgs.libnotify}/bin/notify-send --app-name="$INSTANCE" --urgency=critical \
|
||||
"Service '$INSTANCE' failed" \
|
||||
"$(journalctl -n 6 -o cat -u $INSTANCE)"
|
||||
'';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue