Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
systemd.services."unit-status@" = {
path = [ (pkgs.curl) (pkgs.systemd) ];
serviceConfig.ExecStart = "${
pkgs.writeScript "notifier" ''
#!${pkgs.bash}/bin/bash
curl -s \
--form-string "token=${secrets.pushover.token}" \
--form-string "user=${secrets.pushover.user}" \
--form-string "title=$2 - $1 failed." \
--form-string "message=$(journalctl -u $1 -n 5)" \
https://api.pushover.net/1/messages.json
''
} %I %H %m";
};
systemd.services.ogre-rsync = {
after = [ "zfs-import-tank.service" ];
path = [ (pkgs.rsync) ];
onFailure = [ "unit-status@%n" ];
script = ''
rsync -Hax --exclude=/nix/store --delete / /tank/backup/ogre/
'';
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.