about summary refs log tree commit diff
path: root/nixos/modules/services/backup/znapzend.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/services/backup/znapzend.nix')
-rw-r--r--nixos/modules/services/backup/znapzend.nix10
1 files changed, 8 insertions, 2 deletions
diff --git a/nixos/modules/services/backup/znapzend.nix b/nixos/modules/services/backup/znapzend.nix
index 8c5af80c8fb7..baf99930e3eb 100644
--- a/nixos/modules/services/backup/znapzend.nix
+++ b/nixos/modules/services/backup/znapzend.nix
@@ -27,7 +27,13 @@ in
       noDestroy = mkOption {
         type = types.bool;
         default = false;
-        description = "Does all changes to the filesystem except destroy";
+        description = "Does all changes to the filesystem except destroy.";
+      };
+
+      autoCreation = mkOption {
+        type = types.bool;
+        default = false;
+        description = "Automatically create the dataset on dest if it does not exists.";
       };
     };
   };
@@ -44,7 +50,7 @@ in
         path = with pkgs; [ zfs mbuffer openssh ];
 
         serviceConfig = {
-          ExecStart = "${pkgs.znapzend}/bin/znapzend --logto=${cfg.logTo} --loglevel=${cfg.logLevel} ${optionalString cfg.noDestroy "--nodestroy"}";
+          ExecStart = "${pkgs.znapzend}/bin/znapzend --logto=${cfg.logTo} --loglevel=${cfg.logLevel} ${optionalString cfg.noDestroy "--nodestroy"} ${optionalString cfg.autoCreation "--autoCreation"}";
           ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
           Restart = "on-failure";
         };