challenger: more minor migrations
This commit is contained in:
38
hosts/challenger/backup.nix
Normal file
38
hosts/challenger/backup.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
services.borgbackup.jobs =
|
||||
let
|
||||
borgJob = name: {
|
||||
environment.BORG_RSH = "ssh -i /root/.ssh/fealsyn1";
|
||||
environment.BORG_REMOTE_PATH = "/usr/local/bin/borg";
|
||||
repo = "ssh://backup@feal-syn1.home.feal.no/volume2/backup/borg/voyager/${name}";
|
||||
compression = "auto,zstd";
|
||||
};
|
||||
in {
|
||||
postgresDaily = borgJob "postgres::daily" // {
|
||||
paths = "/var/backup/postgres";
|
||||
startAt = "*-*-* 05:15:00"; # 2 hours after postgresqlBackup
|
||||
extraInitArgs = "--storage-quota 10G";
|
||||
encryption = {
|
||||
mode = "repokey-blake2";
|
||||
passCommand = "cat ${config.sops.secrets."borg/postgres".path}";
|
||||
};
|
||||
};
|
||||
|
||||
postgresWeekly = borgJob "postgres::weekly" // {
|
||||
paths = "/var/backup/postgres";
|
||||
startAt = "Mon *-*-* 05:15:00"; # 2 hours after postgresqlBackup
|
||||
extraInitArgs = "--storage-quota 10G";
|
||||
encryption = {
|
||||
mode = "repokey-blake2";
|
||||
passCommand = "cat ${config.sops.secrets."borg/postgres".path}";
|
||||
};
|
||||
};
|
||||
|
||||
# TODO: timemachine, nextcloud, komga, calibre
|
||||
|
||||
};
|
||||
|
||||
sops.secrets."borg/postgres" = { };
|
||||
sops.secrets."borg/transmission" = { };
|
||||
}
|
||||
@@ -3,9 +3,11 @@
|
||||
{
|
||||
imports =
|
||||
[
|
||||
./hardware-configuration.nix
|
||||
|
||||
../../base.nix
|
||||
../../common/metrics-exporters.nix
|
||||
./hardware-configuration.nix
|
||||
./backup.nix
|
||||
./exports.nix
|
||||
./filesystems.nix
|
||||
|
||||
|
||||
@@ -17,13 +17,13 @@ in {
|
||||
static_configs = [
|
||||
{
|
||||
targets = [
|
||||
"voyager.home.feal.no:9100"
|
||||
"sulu.home.feal.no:9100"
|
||||
"mccoy.home.feal.no:9100"
|
||||
"challenger.home.feal.no:9100"
|
||||
"defiant.home.feal.no:9100"
|
||||
"dlink-feal.home.feal.no:9100"
|
||||
"edison.home.feal.no:9100"
|
||||
"defiant.home.feal.no:9100"
|
||||
"mccoy.home.feal.no:9100"
|
||||
"scotty.home.feal.no:9100"
|
||||
"sulu.home.feal.no:9100"
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user