From 8636e033d3390e2a754c76ca645a687f7e89548e Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 17 Dec 2017 00:35:04 +0100 Subject: =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom/btrfs-snapshots.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'custom/btrfs-snapshots.nix') diff --git a/custom/btrfs-snapshots.nix b/custom/btrfs-snapshots.nix index 038ec2c4..31ff6df9 100644 --- a/custom/btrfs-snapshots.nix +++ b/custom/btrfs-snapshots.nix @@ -35,13 +35,14 @@ in { systemd.services."btrfs-snapshot@" = { enable = true; - path = with pkgs; [btrfs-progs]; unitConfig = { AssertPathIsDirectory = cfg.mountPoint; + StopWhenUnneeded = true; }; serviceConfig = with pkgs; { + Type = "oneshot"; ExecStart = "${btrfs-progs}/bin/btrfs subvolume snapshot ${optionalString cfg.readOnly "-r"} %f ${snapshotMount "%i"}"; RemainAfterExit = true; ExecStop = "${btrfs-progs}/bin/btrfs subvolume delete -c ${snapshotMount "%i"}"; -- cgit v1.2.3