summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-04-09 15:58:09 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-04-09 15:58:09 +0200
commitbf95414b67bd2aef3a5ab4e97717959ff37d2c12 (patch)
tree3a684d534096bdf009092f548c4455333b7c6bae
parentc91562f3acb0a5321fb771a30f605d3957c373a9 (diff)
downloadnixos-bf95414b67bd2aef3a5ab4e97717959ff37d2c12.tar
nixos-bf95414b67bd2aef3a5ab4e97717959ff37d2c12.tar.gz
nixos-bf95414b67bd2aef3a5ab4e97717959ff37d2c12.tar.bz2
nixos-bf95414b67bd2aef3a5ab4e97717959ff37d2c12.tar.xz
nixos-bf95414b67bd2aef3a5ab4e97717959ff37d2c12.zip
-rw-r--r--custom/lvm-snapshots.nix7
1 files changed, 5 insertions, 2 deletions
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 {
70 70
71 description = "LVM-snapshot of ${scfg.VG}/${scfg.LV}"; 71 description = "LVM-snapshot of ${scfg.VG}/${scfg.LV}";
72 72
73 requiredBy = ["${escapeSystemdPath "/dev/${scfg.VG}/${snapshotName name}"}.device"];
74
73 unitConfig = { 75 unitConfig = {
74 StopWhenUnneeded = !scfg.persist; 76 StopWhenUnneeded = !scfg.persist;
75 AssertPathIsDirectory = "/var/lock"; 77 AssertPathIsDirectory = "/var/lock";
76 RequiredBy = "${escapeSystemdPath "/dev/${scfg.VG}/${snapshotName name}"}.device";
77 }; 78 };
78 79
79 path = with pkgs; [ devicemapper utillinux ]; 80 path = with pkgs; [ devicemapper utillinux ];
@@ -117,9 +118,11 @@ in {
117 systemd.automounts = mapAttrsToList (name: scfg: { 118 systemd.automounts = mapAttrsToList (name: scfg: {
118 enable = true; 119 enable = true;
119 120
121 wantedBy = [ "default.target" ];
122
120 automountConfig = { 123 automountConfig = {
121 TimeoutIdleSec = "5"; 124 TimeoutIdleSec = "5";
122 DirectoryMode = "0700"; 125 DirectoryMode = "0700"q;
123 }; 126 };
124 127
125 where = snapshotMount name; 128 where = snapshotMount name;