summaryrefslogtreecommitdiff
path: root/modules/zfssnap/default.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-11-01 22:43:25 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2022-11-01 22:43:25 +0100
commit7448d3431fcfc05f9b7991e337b02083300a99db (patch)
tree0664ebc0f666ef404881ac7287198ff44c0ba9e0 /modules/zfssnap/default.nix
parent234eab10a84e7ffb8bbc32f5e2f94495d3c9aedd (diff)
downloadnixos-7448d3431fcfc05f9b7991e337b02083300a99db.tar
nixos-7448d3431fcfc05f9b7991e337b02083300a99db.tar.gz
nixos-7448d3431fcfc05f9b7991e337b02083300a99db.tar.bz2
nixos-7448d3431fcfc05f9b7991e337b02083300a99db.tar.xz
nixos-7448d3431fcfc05f9b7991e337b02083300a99db.zip
...
Diffstat (limited to 'modules/zfssnap/default.nix')
-rw-r--r--modules/zfssnap/default.nix18
1 files changed, 16 insertions, 2 deletions
diff --git a/modules/zfssnap/default.nix b/modules/zfssnap/default.nix
index f46cd510..f6f32852 100644
--- a/modules/zfssnap/default.nix
+++ b/modules/zfssnap/default.nix
@@ -48,6 +48,20 @@ in {
48 type = types.str; 48 type = types.str;
49 default = "*-*-* *:00/5:00"; 49 default = "*-*-* *:00/5:00";
50 }; 50 };
51
52 verbosity = mkOption {
53 type = types.int;
54 default = 2;
55 };
56
57 extraPruneArgs = mkOption {
58 type = with types; listOf str;
59 default = [];
60 };
61 extraAutosnapArgs = mkOption {
62 type = with types; listOf str;
63 default = [];
64 };
51 }; 65 };
52 }; 66 };
53 67
@@ -59,7 +73,7 @@ in {
59 before = [ "zfssnap-prune.service" ]; 73 before = [ "zfssnap-prune.service" ];
60 serviceConfig = { 74 serviceConfig = {
61 Type = "oneshot"; 75 Type = "oneshot";
62 ExecStart = "${zfssnap}/bin/zfssnap -vv"; 76 ExecStart = "${zfssnap}/bin/zfssnap --verbosity=${toString cfg.verbosity} autosnap ${escapeShellArgs cfg.extraAutosnapArgs}";
63 77
64 LogRateLimitIntervalSec = 0; 78 LogRateLimitIntervalSec = 0;
65 }; 79 };
@@ -72,7 +86,7 @@ in {
72 ExecStart = let 86 ExecStart = let
73 mkSectionName = name: strings.escape [ "[" "]" ] (strings.toUpper name); 87 mkSectionName = name: strings.escape [ "[" "]" ] (strings.toUpper name);
74 zfssnapConfig = generators.toINI { inherit mkSectionName; } cfg.config; 88 zfssnapConfig = generators.toINI { inherit mkSectionName; } cfg.config;
75 in "${zfssnap}/bin/zfssnap -vv prune --config=${pkgs.writeText "zfssnap.ini" zfssnapConfig}"; 89 in "${zfssnap}/bin/zfssnap --verbosity=${toString cfg.verbosity} prune --config=${pkgs.writeText "zfssnap.ini" zfssnapConfig} ${escapeShellArgs cfg.extraPruneArgs}";
76 90
77 LogRateLimitIntervalSec = 0; 91 LogRateLimitIntervalSec = 0;
78 }; 92 };