summaryrefslogtreecommitdiff
path: root/custom/btrfs-snapshots.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2017-12-17 00:35:04 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2017-12-17 00:35:04 +0100
commit8636e033d3390e2a754c76ca645a687f7e89548e (patch)
tree81497b2314a1a3e1062f2f2c18a16e83dc3895e5 /custom/btrfs-snapshots.nix
parent2b6d745cad4b06f1d746bf6966b24f1a509f22dc (diff)
downloadnixos-8636e033d3390e2a754c76ca645a687f7e89548e.tar
nixos-8636e033d3390e2a754c76ca645a687f7e89548e.tar.gz
nixos-8636e033d3390e2a754c76ca645a687f7e89548e.tar.bz2
nixos-8636e033d3390e2a754c76ca645a687f7e89548e.tar.xz
nixos-8636e033d3390e2a754c76ca645a687f7e89548e.zip
Diffstat (limited to 'custom/btrfs-snapshots.nix')
-rw-r--r--custom/btrfs-snapshots.nix3
1 files changed, 2 insertions, 1 deletions
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 {
35 35
36 systemd.services."btrfs-snapshot@" = { 36 systemd.services."btrfs-snapshot@" = {
37 enable = true; 37 enable = true;
38 path = with pkgs; [btrfs-progs];
39 38
40 unitConfig = { 39 unitConfig = {
41 AssertPathIsDirectory = cfg.mountPoint; 40 AssertPathIsDirectory = cfg.mountPoint;
41 StopWhenUnneeded = true;
42 }; 42 };
43 43
44 serviceConfig = with pkgs; { 44 serviceConfig = with pkgs; {
45 Type = "oneshot";
45 ExecStart = "${btrfs-progs}/bin/btrfs subvolume snapshot ${optionalString cfg.readOnly "-r"} %f ${snapshotMount "%i"}"; 46 ExecStart = "${btrfs-progs}/bin/btrfs subvolume snapshot ${optionalString cfg.readOnly "-r"} %f ${snapshotMount "%i"}";
46 RemainAfterExit = true; 47 RemainAfterExit = true;
47 ExecStop = "${btrfs-progs}/bin/btrfs subvolume delete -c ${snapshotMount "%i"}"; 48 ExecStop = "${btrfs-progs}/bin/btrfs subvolume delete -c ${snapshotMount "%i"}";