forked from mirrors_public/oddlama_nix-config
fix: restic backups should run as root
This commit is contained in:
parent
78ecdd2780
commit
38a89b05a3
5 changed files with 7 additions and 11 deletions
|
@ -116,7 +116,6 @@ in {
|
||||||
|
|
||||||
backups.storageBoxes.dusk = {
|
backups.storageBoxes.dusk = {
|
||||||
subuser = "paperless";
|
subuser = "paperless";
|
||||||
user = "paperless";
|
|
||||||
paths = [paperlessBackupDir];
|
paths = [paperlessBackupDir];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -349,7 +349,6 @@ in {
|
||||||
|
|
||||||
backups.storageBoxes.dusk = {
|
backups.storageBoxes.dusk = {
|
||||||
subuser = "samba";
|
subuser = "samba";
|
||||||
user = "root";
|
|
||||||
paths = ["/bunker"];
|
paths = ["/bunker"];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,6 @@ in {
|
||||||
|
|
||||||
backups.storageBoxes.dusk = {
|
backups.storageBoxes.dusk = {
|
||||||
subuser = "radicale";
|
subuser = "radicale";
|
||||||
user = "radicale";
|
|
||||||
paths = ["/var/lib/radicale"];
|
paths = ["/var/lib/radicale"];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,6 @@ in {
|
||||||
|
|
||||||
backups.storageBoxes.dusk = {
|
backups.storageBoxes.dusk = {
|
||||||
subuser = "vaultwarden";
|
subuser = "vaultwarden";
|
||||||
user = "vaultwarden";
|
|
||||||
paths = [config.services.vaultwarden.backupDir];
|
paths = [config.services.vaultwarden.backupDir];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,11 +29,6 @@ in {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
};
|
};
|
||||||
|
|
||||||
user = mkOption {
|
|
||||||
description = "The user as which restic should run.";
|
|
||||||
type = types.str;
|
|
||||||
};
|
|
||||||
|
|
||||||
paths = mkOption {
|
paths = mkOption {
|
||||||
description = "The paths to backup.";
|
description = "The paths to backup.";
|
||||||
type = types.listOf types.path;
|
type = types.listOf types.path;
|
||||||
|
@ -58,8 +53,13 @@ in {
|
||||||
sshAgeSecret = "restic-ssh-privkey";
|
sshAgeSecret = "restic-ssh-privkey";
|
||||||
};
|
};
|
||||||
|
|
||||||
# We need to backup stuff from other users, so run as root.
|
# A) We need to backup stuff from other users, so run as root.
|
||||||
inherit (boxCfg) user paths;
|
# B) We also need to be root because the ssh key will only
|
||||||
|
# be accessible to root so whatever service is running cannot
|
||||||
|
# just access our backup server.
|
||||||
|
user = "root";
|
||||||
|
|
||||||
|
inherit (boxCfg) paths;
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
OnCalendar = "06:15";
|
OnCalendar = "06:15";
|
||||||
RandomizedDelaySec = "3h";
|
RandomizedDelaySec = "3h";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue