fix: restic backups should run as root

This commit is contained in:
oddlama 2024-01-20 03:23:37 +01:00
parent 78ecdd2780
commit 38a89b05a3
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
5 changed files with 7 additions and 11 deletions

View file

@ -29,11 +29,6 @@ in {
type = types.str;
};
user = mkOption {
description = "The user as which restic should run.";
type = types.str;
};
paths = mkOption {
description = "The paths to backup.";
type = types.listOf types.path;
@ -58,8 +53,13 @@ in {
sshAgeSecret = "restic-ssh-privkey";
};
# We need to backup stuff from other users, so run as root.
inherit (boxCfg) user paths;
# A) We need to backup stuff from other users, so run as root.
# 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 = {
OnCalendar = "06:15";
RandomizedDelaySec = "3h";