diff options
| -rw-r--r-- | custom/borgbackup.nix | 2 | ||||
| -rw-r--r-- | custom/lvm-snapshots.nix | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/custom/borgbackup.nix b/custom/borgbackup.nix index d68f635d..2cd42e68 100644 --- a/custom/borgbackup.nix +++ b/custom/borgbackup.nix | |||
| @@ -118,7 +118,6 @@ in { | |||
| 118 | systemd.services = (mapAttrs' (target: tCfg: nameValuePair "borgbackup-${target}@" (let | 118 | systemd.services = (mapAttrs' (target: tCfg: nameValuePair "borgbackup-${target}@" (let |
| 119 | deps = flatten [ | 119 | deps = flatten [ |
| 120 | (optional (cfg.snapshots == "btrfs") "btrfs-snapshot@%i.service") | 120 | (optional (cfg.snapshots == "btrfs") "btrfs-snapshot@%i.service") |
| 121 | (optional (cfg.snapshots == "lvm") "${escapeSystemdPath "${mountPoint}/${withPrefix "%i"}"}.mount") | ||
| 122 | (optional tCfg.network "network-online.target") | 121 | (optional tCfg.network "network-online.target") |
| 123 | ]; | 122 | ]; |
| 124 | in { | 123 | in { |
| @@ -147,6 +146,7 @@ in { | |||
| 147 | unitConfig = { | 146 | unitConfig = { |
| 148 | AssertPathIsDirectory = mkIf (tCfg.lock != null) "/var/lock"; | 147 | AssertPathIsDirectory = mkIf (tCfg.lock != null) "/var/lock"; |
| 149 | DefaultDependencies = false; | 148 | DefaultDependencies = false; |
| 149 | RequiresMountsFor = mkIf (cfg.snapshots == "lvm") [ "${mountPoint}/${withPrefix "%i"}" ]; | ||
| 150 | }; | 150 | }; |
| 151 | 151 | ||
| 152 | serviceConfig = { | 152 | serviceConfig = { |
diff --git a/custom/lvm-snapshots.nix b/custom/lvm-snapshots.nix index 7d6cb8f2..2d047599 100644 --- a/custom/lvm-snapshots.nix +++ b/custom/lvm-snapshots.nix | |||
| @@ -109,6 +109,7 @@ in { | |||
| 109 | bindsTo = [ ("lvm-snapshot@" + scfg.VG + "-" + snapshotName name + ".service") ]; | 109 | bindsTo = [ ("lvm-snapshot@" + scfg.VG + "-" + snapshotName name + ".service") ]; |
| 110 | after = [ ("lvm-snapshot@" + scfg.VG + "-" + snapshotName name + ".service") ]; | 110 | after = [ ("lvm-snapshot@" + scfg.VG + "-" + snapshotName name + ".service") ]; |
| 111 | 111 | ||
| 112 | options = [ "noauto" ]; | ||
| 112 | options = mkIf scfg.readOnly "ro"; | 113 | options = mkIf scfg.readOnly "ro"; |
| 113 | 114 | ||
| 114 | where = snapshotMount name; | 115 | where = snapshotMount name; |
