style: reformat all nix files

This commit is contained in:
Felix Schröter 2025-09-15 20:46:37 +02:00
parent 0b5daa99ed
commit 2dcb901ae1
Signed by: felschr
GPG key ID: 671E39E6744C807D
8 changed files with 51 additions and 47 deletions

View file

@ -85,34 +85,33 @@ in
}
];
systemd.services."notify@" =
{
onFailure = lib.mkForce [ ];
}
// 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";
INSTANCE = "%i";
};
script = ''
${pkgs.libnotify}/bin/notify-send --urgency=critical \
"Service '$INSTANCE' failed" \
"$(journalctl -n 6 -o cat -u $INSTANCE)"
'';
serviceConfig = {
Type = "oneshot";
User = cfg.libnotify.user;
};
}
// optionalAttrs (cfg.method == "email") {
description = "E-Mail notifications for %i service failure";
serviceConfig = {
ExecStart = "${sendmail} %i";
Type = "oneshot";
};
systemd.services."notify@" = {
onFailure = lib.mkForce [ ];
}
// 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";
INSTANCE = "%i";
};
script = ''
${pkgs.libnotify}/bin/notify-send --urgency=critical \
"Service '$INSTANCE' failed" \
"$(journalctl -n 6 -o cat -u $INSTANCE)"
'';
serviceConfig = {
Type = "oneshot";
User = cfg.libnotify.user;
};
}
// optionalAttrs (cfg.method == "email") {
description = "E-Mail notifications for %i service failure";
serviceConfig = {
ExecStart = "${sendmail} %i";
Type = "oneshot";
};
};
};
}