fix backup

This commit is contained in:
Tim Schubert 2022-12-17 02:36:12 +01:00
parent 62db411fdd
commit 7855de6a3e
Signed by: dadada
GPG key ID: EEB8D1CE62C4DFEA
2 changed files with 24 additions and 26 deletions

View file

@ -58,8 +58,8 @@ in
};
};
config = mkIf cfg.gs.enable {
fileSystems = mkIf cfg.gs {
config = {
fileSystems = mkIf cfg.gs.enable {
"/backup" = {
device = "/dev/disk/by-uuid/0fdab735-cc3e-493a-b4ec-cbf6a77d48d5";
fsType = "ext4";
@ -67,8 +67,7 @@ in
};
};
services.borgbackup.jobs.gs =
{
services.borgbackup.jobs.gs = mkIf cfg.gs.enable {
paths = "/";
exclude = backupExcludes;
repo = "/backup/${config.networking.hostName}";
@ -86,9 +85,9 @@ in
yearly = -1; # Keep at least one archive for each year
};
startAt = "monthly";
}
// mkIf cfg.bs.enable {
services.borgbackup.jobs.bs = {
};
services.borgbackup.jobs.bs = mkIf cfg.bs.enable {
paths = "/";
exclude = backupExcludes;
repo = "borg@backup0.dadada.li:/mnt/storage/backup/${config.networking.hostName}";
@ -107,5 +106,4 @@ in
};
};
};
};
}

View file

@ -5,8 +5,8 @@ in
{
dadada.backupClient.bs = {
enable = true;
passphrasePath = config.age.secrets."${config.networking.hostName}-backup-passphrase.path";
sshIdentityFile = config.age.secrets."${config.networking.hostName}-backup-ssh-key.path";
passphrasePath = config.age.secrets."${config.networking.hostName}-backup-passphrase".path;
sshIdentityFile = config.age.secrets."${config.networking.hostName}-backup-ssh-key".path;
};
age.secrets."${config.networking.hostName}-backup-passphrase".file = "${secretsPath}/${config.networking.hostName}-backup-passphrase.age";