summaryrefslogtreecommitdiff
path: root/custom
diff options
context:
space:
mode:
Diffstat (limited to 'custom')
-rw-r--r--custom/btrfs-snapshots.nix9
1 files changed, 7 insertions, 2 deletions
diff --git a/custom/btrfs-snapshots.nix b/custom/btrfs-snapshots.nix
index 31ff6df9..2722afc3 100644
--- a/custom/btrfs-snapshots.nix
+++ b/custom/btrfs-snapshots.nix
@@ -10,7 +10,7 @@ in {
10 options = { 10 options = {
11 11
12 services.btrfs-snapshots = { 12 services.btrfs-snapshots = {
13 enable = mkEnableOption "btrfs snapshot unit"; 13 enable = mkEnableOption "a systemd unit for btrfs snapshots";
14 14
15 mountPoint = mkOption { 15 mountPoint = mkOption {
16 type = types.path; 16 type = types.path;
@@ -26,6 +26,11 @@ in {
26 type = types.bool; 26 type = types.bool;
27 default = true; 27 default = true;
28 }; 28 };
29
30 persist = mkOption {
31 type = types.bool;
32 default = false;
33 };
29 }; 34 };
30 35
31 }; 36 };
@@ -38,7 +43,7 @@ in {
38 43
39 unitConfig = { 44 unitConfig = {
40 AssertPathIsDirectory = cfg.mountPoint; 45 AssertPathIsDirectory = cfg.mountPoint;
41 StopWhenUnneeded = true; 46 StopWhenUnneeded = !persist;
42 }; 47 };
43 48
44 serviceConfig = with pkgs; { 49 serviceConfig = with pkgs; {