diff --git a/modules/services/borg.nix b/modules/services/borg.nix index b318cec..2b9e9af 100644 --- a/modules/services/borg.nix +++ b/modules/services/borg.nix @@ -1,7 +1,12 @@ -{ pkgs, config, ... }: +{ + pkgs, + config, + username, + ... +}: let hostname = "violet"; - repo = "ssh://dandelion.booping.local:${toString config.services.openssh.ports}/spinners/rootvol/backups/${hostname}"; + baseRepo = "ssh://liv@dandelion:9123/spinners/rootvol/backups/${hostname}"; in { services.borgbackup.jobs = { @@ -9,9 +14,10 @@ in paths = [ "/home/liv/MinecraftDocker" ]; - repo = "${repo}/MinecraftDocker-tulip"; - compression = "auto,zstd"; - startAt = "daily"; + repo = "${baseRepo}/MinecraftDocker-tulip"; + encryption.mode = "none"; + compression = "auto,zstd,10"; + startAt = [ "3:00" ]; 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" @@ -19,12 +25,14 @@ 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 = "${repo}/var-lib"; + repo = "${baseRepo}/var-lib"; + encryption.mode = "none"; compression = "auto,zstd"; startAt = "daily"; postHook = '' @@ -34,30 +42,7 @@ 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 804e1b0..d09612b 100644 --- a/modules/services/violet.nix +++ b/modules/services/violet.nix @@ -3,6 +3,7 @@ imports = [ (import ./invidious.nix) ] ++ [ (import ./anubis.nix) ] + ++ [ (import ./borg.nix) ] ++ [ (import ./binternet-proxy.nix) ] ++ [ (import ./docker.nix) ] ++ [ (import ./frp.nix) ]