summaryrefslogtreecommitdiff
path: root/custom
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-04-09 16:13:21 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-04-09 16:13:21 +0200
commit5589798d1b1824f3ea455fc5f1334c9d61954810 (patch)
treeb9b80ecec52c09dac996abc970b1c0af37e0e873 /custom
parent057c72e9f835964034be6aeb1a0e09c00431b72d (diff)
downloadnixos-5589798d1b1824f3ea455fc5f1334c9d61954810.tar
nixos-5589798d1b1824f3ea455fc5f1334c9d61954810.tar.gz
nixos-5589798d1b1824f3ea455fc5f1334c9d61954810.tar.bz2
nixos-5589798d1b1824f3ea455fc5f1334c9d61954810.tar.xz
nixos-5589798d1b1824f3ea455fc5f1334c9d61954810.zip
Diffstat (limited to 'custom')
-rw-r--r--custom/borgbackup.nix2
-rw-r--r--custom/lvm-snapshots.nix1
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;