summary refs log tree commit diff
path: root/nixos/modules/services/backup
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/services/backup')
-rw-r--r--nixos/modules/services/backup/znapzend.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/nixos/modules/services/backup/znapzend.nix b/nixos/modules/services/backup/znapzend.nix
new file mode 100644
index 000000000000..648089f90b7b
--- /dev/null
+++ b/nixos/modules/services/backup/znapzend.nix
@@ -0,0 +1,36 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  cfg = config.services.znapzend;
+in
+{
+  options = {
+    services.znapzend = {
+      enable = mkEnableOption "ZnapZend daemon";
+    };
+  };
+
+  config = mkIf cfg.enable {
+    environment.systemPackages = [ pkgs.znapzend ];
+
+    systemd.services = {
+      "znapzend" = {
+        description = "ZnapZend - ZFS Backup System";
+        after       = [ "zfs.target" ];
+
+        path = with pkgs; [ znapzend zfs mbuffer openssh ];
+
+        script = ''
+          znapzend
+        '';
+
+        reload = ''
+          /bin/kill -HUP $MAINPID
+        '';
+      };
+    };
+
+  };
+}