fix backup
This commit is contained in:
parent
62db411fdd
commit
7855de6a3e
2 changed files with 24 additions and 26 deletions
|
@ -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,26 +85,25 @@ 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}";
|
||||||
doInit = false;
|
doInit = false;
|
||||||
environment = {
|
environment = {
|
||||||
BORG_RSH = "ssh -i ${cfg.bs.sshIdentityFile} -o 'StrictHostKeyChecking accept-new' -o 'TCPKeepAlive=yes'";
|
BORG_RSH = "ssh -i ${cfg.bs.sshIdentityFile} -o 'StrictHostKeyChecking accept-new' -o 'TCPKeepAlive=yes'";
|
||||||
};
|
|
||||||
encryption = {
|
|
||||||
mode = "repokey";
|
|
||||||
passCommand = "cat ${cfg.bs.passphrasePath}";
|
|
||||||
};
|
|
||||||
compression = "auto,lz4";
|
|
||||||
startAt = "daily";
|
|
||||||
environment = {
|
|
||||||
BORG_RELOCATED_REPO_ACCESS_IS_OK = "yes";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
encryption = {
|
||||||
|
mode = "repokey";
|
||||||
|
passCommand = "cat ${cfg.bs.passphrasePath}";
|
||||||
|
};
|
||||||
|
compression = "auto,lz4";
|
||||||
|
startAt = "daily";
|
||||||
|
environment = {
|
||||||
|
BORG_RELOCATED_REPO_ACCESS_IS_OK = "yes";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -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";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue