mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-04 15:00:13 +01:00
clean: delete backups script since these are all in different places now
This commit is contained in:
parent
439fee719e
commit
21f93302cc
1 changed files with 0 additions and 54 deletions
|
|
@ -1,54 +0,0 @@
|
||||||
let
|
|
||||||
borgbackupMonitor =
|
|
||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with lib;
|
|
||||||
{
|
|
||||||
key = "borgbackupMonitor";
|
|
||||||
_file = "borgbackupMonitor";
|
|
||||||
config.systemd.services =
|
|
||||||
{
|
|
||||||
"notify-problems@" = {
|
|
||||||
enable = true;
|
|
||||||
serviceConfig.User = "liv";
|
|
||||||
environment.SERVICE = "%i";
|
|
||||||
script = ''
|
|
||||||
${pkgs.curl}/bin/curl -d "$SERVICE FAILED! - service $SERVICE on host $(hostname) failed, run journalctl -u $SERVICE for details."
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
// flip mapAttrs' config.services.borgbackup.jobs (
|
|
||||||
name: value:
|
|
||||||
nameValuePair "borgbackup-job-${name}" {
|
|
||||||
unitConfig.OnFailure = "notify-problems@%i.service";
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
# optional, but this actually forces backup after boot in case laptop was powered off during scheduled event
|
|
||||||
# for example, if you scheduled backups daily, your laptop should be powered on at 00:00
|
|
||||||
config.systemd.timers = flip mapAttrs' config.services.borgbackup.jobs (
|
|
||||||
name: value:
|
|
||||||
nameValuePair "borgbackup-job-${name}" {
|
|
||||||
timerConfig.Persistent = true;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
in
|
|
||||||
{
|
|
||||||
imports = [ borgbackupMonitor ];
|
|
||||||
services = {
|
|
||||||
borgbackup.jobs.liv-violet = {
|
|
||||||
paths = "/home/liv";
|
|
||||||
encryption.mode = "none";
|
|
||||||
environment.BORG_RSH = "ssh -i /home/liv/.ssh/id_ed25519";
|
|
||||||
repo = "ssh://liv@100.115.178.50:9123/spinners/rootvol/backups/hosts/violet";
|
|
||||||
compression = "auto,zstd";
|
|
||||||
startAt = "daily";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue