From 5589798d1b1824f3ea455fc5f1334c9d61954810 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 9 Apr 2018 16:13:21 +0200 Subject: =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom/borgbackup.nix | 2 +- custom/lvm-snapshots.nix | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 { systemd.services = (mapAttrs' (target: tCfg: nameValuePair "borgbackup-${target}@" (let deps = flatten [ (optional (cfg.snapshots == "btrfs") "btrfs-snapshot@%i.service") - (optional (cfg.snapshots == "lvm") "${escapeSystemdPath "${mountPoint}/${withPrefix "%i"}"}.mount") (optional tCfg.network "network-online.target") ]; in { @@ -147,6 +146,7 @@ in { unitConfig = { AssertPathIsDirectory = mkIf (tCfg.lock != null) "/var/lock"; DefaultDependencies = false; + RequiresMountsFor = mkIf (cfg.snapshots == "lvm") [ "${mountPoint}/${withPrefix "%i"}" ]; }; 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 { bindsTo = [ ("lvm-snapshot@" + scfg.VG + "-" + snapshotName name + ".service") ]; after = [ ("lvm-snapshot@" + scfg.VG + "-" + snapshotName name + ".service") ]; + options = [ "noauto" ]; options = mkIf scfg.readOnly "ro"; where = snapshotMount name; -- cgit v1.2.3