Merge branch 'fix-borg-home' into 'master'

Set HOME to private /tmp for borgbackup

See merge request simple-nixos-mailserver/nixos-mailserver!359
This commit is contained in:
Levi Zim 2025-03-22 11:33:05 +00:00
commit 27c08decf7

View File

@ -65,12 +65,16 @@ in {
description = "borgbackup";
unitConfig.Documentation = "man:borgbackup";
script = borgScript;
# borg writes to $HOME/.config but in our case it also works on $HOME (/var/vmail)
# Setting $HOME to /tmp to avoid it
environment.HOME = "/tmp";
serviceConfig = {
User = cfg.user;
Group = cfg.group;
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
ProtectSystem = "full";
PrivateTmp = true;
};
startAt = cfg.startAt;
};