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") {
|
// optionalAttrs (cfg.method == "libnotify") {
|
||||||
description = "Desktop notifications for %i service failure";
|
description = "Desktop notifications for %i service failure";
|
||||||
environment = {
|
environment = {
|
||||||
DBUS_SESSION_BUS_ADDRESS = "unix:path=/run/user/${
|
DISPLAY = ":0";
|
||||||
toString config.users.users.${cfg.libnotify.user}.uid
|
|
||||||
}/bus";
|
|
||||||
INSTANCE = "%i";
|
INSTANCE = "%i";
|
||||||
};
|
};
|
||||||
script = ''
|
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" \
|
"Service '$INSTANCE' failed" \
|
||||||
"$(journalctl -n 6 -o cat -u $INSTANCE)"
|
"$(journalctl -n 6 -o cat -u $INSTANCE)"
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue