diff --git a/modules/services/borg.nix b/modules/services/borg.nix index 2b9e9af..b318cec 100644 --- a/modules/services/borg.nix +++ b/modules/services/borg.nix @@ -1,12 +1,7 @@ -{ - pkgs, - config, - username, - ... -}: +{ pkgs, config, ... }: let hostname = "violet"; - baseRepo = "ssh://liv@dandelion:9123/spinners/rootvol/backups/${hostname}"; + repo = "ssh://dandelion.booping.local:${toString config.services.openssh.ports}/spinners/rootvol/backups/${hostname}"; in { services.borgbackup.jobs = { @@ -14,10 +9,9 @@ in paths = [ "/home/liv/MinecraftDocker" ]; - repo = "${baseRepo}/MinecraftDocker-tulip"; - encryption.mode = "none"; - compression = "auto,zstd,10"; - startAt = [ "3:00" ]; + repo = "${repo}/MinecraftDocker-tulip"; + compression = "auto,zstd"; + startAt = "daily"; postHook = '' if [ $exitStatus -eq 2 ]; then ${pkgs.ntfy-sh}/bin/ntfy send https://ntfy.liv.town/${hostname} "borgbackup: ${hostname} backup (violet-minecraft) failed with errors" @@ -25,14 +19,12 @@ in ${pkgs.ntfy-sh}/bin/ntfy send https://ntfy.liv.town/${hostname} "borgbackup: ${hostname} backup (violet-minecraft) completed succesfully with exit status $exitStatus" fi ''; - user = "${username}"; }; "violet-lib" = { paths = [ "/var/lib" ]; - repo = "${baseRepo}/var-lib"; - encryption.mode = "none"; + repo = "${repo}/var-lib"; compression = "auto,zstd"; startAt = "daily"; postHook = '' @@ -42,7 +34,30 @@ in ${pkgs.ntfy-sh}/bin/ntfy send https://ntfy.liv.town/${hostname} "borgbackup: ${hostname} backup (violet-lib) completed succesfully with exit status $exitStatus" fi ''; - user = "${username}"; }; + # "violet-random" = { + # paths = [ + # "/random" + # ]; + # exclude = [ + # "/random/a" + # "/random/a" + # ]; + # encryption = { + # mode = ""; + # passCommand = ""; + # }; + # environment.BORG_RSH = "ssh -i ${config.sops.secrets."ssh_private_key_violet".path}"; + # repo = "${repo}/violet/random"; + # compression = "auto,zstd"; + # startAt = "daily"; + # postHook = '' + # if [ $exitStatus -eq 2 ]; then + # ${pkgs.ntfy-sh}/bin/ntfy send https://ntfy.${domain}/nixbox "BorgBackup: nixbox backup failed with errors" + # else + # ${pkgs.ntfy-sh}/bin/ntfy send https://ntfy.${domain}/nixbox "BorgBackup: nixbox backup completed succesfully with exit status $exitStatus" + # fi + # ''; + # }; }; } diff --git a/modules/services/violet.nix b/modules/services/violet.nix index d09612b..804e1b0 100644 --- a/modules/services/violet.nix +++ b/modules/services/violet.nix @@ -3,7 +3,6 @@ imports = [ (import ./invidious.nix) ] ++ [ (import ./anubis.nix) ] - ++ [ (import ./borg.nix) ] ++ [ (import ./binternet-proxy.nix) ] ++ [ (import ./docker.nix) ] ++ [ (import ./frp.nix) ]