From bf95414b67bd2aef3a5ab4e97717959ff37d2c12 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 9 Apr 2018 15:58:09 +0200 Subject: =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom/lvm-snapshots.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'custom') diff --git a/custom/lvm-snapshots.nix b/custom/lvm-snapshots.nix index 45282d28..ba15a7db 100644 --- a/custom/lvm-snapshots.nix +++ b/custom/lvm-snapshots.nix @@ -70,10 +70,11 @@ in { description = "LVM-snapshot of ${scfg.VG}/${scfg.LV}"; + requiredBy = ["${escapeSystemdPath "/dev/${scfg.VG}/${snapshotName name}"}.device"]; + unitConfig = { StopWhenUnneeded = !scfg.persist; AssertPathIsDirectory = "/var/lock"; - RequiredBy = "${escapeSystemdPath "/dev/${scfg.VG}/${snapshotName name}"}.device"; }; path = with pkgs; [ devicemapper utillinux ]; @@ -117,9 +118,11 @@ in { systemd.automounts = mapAttrsToList (name: scfg: { enable = true; + wantedBy = [ "default.target" ]; + automountConfig = { TimeoutIdleSec = "5"; - DirectoryMode = "0700"; + DirectoryMode = "0700"q; }; where = snapshotMount name; -- cgit v1.2.3