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 { config = {
fileSystems = mkIf cfg.gs { fileSystems = mkIf cfg.gs.enable {
"/backup" = { "/backup" = {
device = "/dev/disk/by-uuid/0fdab735-cc3e-493a-b4ec-cbf6a77d48d5"; device = "/dev/disk/by-uuid/0fdab735-cc3e-493a-b4ec-cbf6a77d48d5";
fsType = "ext4"; fsType = "ext4";
@ -67,8 +67,7 @@ in
}; };
}; };
services.borgbackup.jobs.gs = services.borgbackup.jobs.gs = mkIf cfg.gs.enable {
{
paths = "/"; paths = "/";
exclude = backupExcludes; exclude = backupExcludes;
repo = "/backup/${config.networking.hostName}"; repo = "/backup/${config.networking.hostName}";
@ -86,9 +85,9 @@ in
yearly = -1; # Keep at least one archive for each year yearly = -1; # Keep at least one archive for each year
}; };
startAt = "monthly"; startAt = "monthly";
} };
// mkIf cfg.bs.enable {
services.borgbackup.jobs.bs = { services.borgbackup.jobs.bs = mkIf cfg.bs.enable {
paths = "/"; paths = "/";
exclude = backupExcludes; exclude = backupExcludes;
repo = "borg@backup0.dadada.li:/mnt/storage/backup/${config.networking.hostName}"; 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 = { dadada.backupClient.bs = {
enable = true; enable = true;
passphrasePath = config.age.secrets."${config.networking.hostName}-backup-passphrase.path"; passphrasePath = config.age.secrets."${config.networking.hostName}-backup-passphrase".path;
sshIdentityFile = config.age.secrets."${config.networking.hostName}-backup-ssh-key.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"; age.secrets."${config.networking.hostName}-backup-passphrase".file = "${secretsPath}/${config.networking.hostName}-backup-passphrase.age";