summaryrefslogtreecommitdiff
path: root/custom/borgbackup.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-09-26 14:12:43 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-09-26 14:12:43 +0200
commit44463eaa988e22a0e970c4e9a1b47db3f54356bd (patch)
treecc6a3803d9507ee4ab829a55edbf118171635e21 /custom/borgbackup.nix
parented3148f8d031e54a1880cc1ba9193de5f50e560d (diff)
downloadnixos-44463eaa988e22a0e970c4e9a1b47db3f54356bd.tar
nixos-44463eaa988e22a0e970c4e9a1b47db3f54356bd.tar.gz
nixos-44463eaa988e22a0e970c4e9a1b47db3f54356bd.tar.bz2
nixos-44463eaa988e22a0e970c4e9a1b47db3f54356bd.tar.xz
nixos-44463eaa988e22a0e970c4e9a1b47db3f54356bd.zip
...
Diffstat (limited to 'custom/borgbackup.nix')
-rw-r--r--custom/borgbackup.nix11
1 files changed, 4 insertions, 7 deletions
diff --git a/custom/borgbackup.nix b/custom/borgbackup.nix
index c67287a4..3871af0a 100644
--- a/custom/borgbackup.nix
+++ b/custom/borgbackup.nix
@@ -104,13 +104,7 @@ in {
104 wantedBy = [ "timers.target" ]; 104 wantedBy = [ "timers.target" ];
105 }; 105 };
106 106
107 systemd.slices."system-borgbackup" = { 107 systemd.slices."system-borgbackup" = {};
108 sliceConfig = {
109 Nice = 15;
110 IOSchedulingClass = 2;
111 IOSchedulingPriority = 7;
112 };
113 };
114 108
115 systemd.timers = (listToAttrs (map ({ target, path, tCfg }: nameValuePair "borgbackup-${target}@${systemdPath path}" { 109 systemd.timers = (listToAttrs (map ({ target, path, tCfg }: nameValuePair "borgbackup-${target}@${systemdPath path}" {
116 requiredBy = [ "timers-borg.target" ]; 110 requiredBy = [ "timers-borg.target" ];
@@ -171,6 +165,9 @@ in {
171 serviceConfig = { 165 serviceConfig = {
172 Type = "oneshot"; 166 Type = "oneshot";
173 WorkingDirectory = if (cfg.snapshots == null) then "%I" else (if (cfg.snapshots == "lvm") then "${mountPoint}/${withPrefix "%I"}" else "${mountPoint}/${withPrefix "%i"}"); 167 WorkingDirectory = if (cfg.snapshots == null) then "%I" else (if (cfg.snapshots == "lvm") then "${mountPoint}/${withPrefix "%I"}" else "${mountPoint}/${withPrefix "%i"}");
168 Nice = 15;
169 IOSchedulingClass = 2;
170 IOSchedulingPriority = 7;
174 SuccessExitStatus = [1 2]; 171 SuccessExitStatus = [1 2];
175 Slice = "system-borgbackup.slice"; 172 Slice = "system-borgbackup.slice";
176 }; 173 };