summary refs log tree commit diff
path: root/nixos/modules/services/backup
diff options
context:
space:
mode:
authorArseniy Seroka <jagajaga@users.noreply.github.com>2016-03-24 23:10:40 +0300
committerArseniy Seroka <jagajaga@users.noreply.github.com>2016-03-24 23:10:40 +0300
commit23585829764622bd87a770a70d0e4ba6f5ec08a3 (patch)
tree17275421d2ec8f9a3a85221bd9f720aeb5bab74b /nixos/modules/services/backup
parent311ddcbd7a77fbbf89da5403a0b095718b81d802 (diff)
parent3ff417cbb71ce875367d9a5b8341a7ce16a41664 (diff)
downloadnixlib-23585829764622bd87a770a70d0e4ba6f5ec08a3.tar
nixlib-23585829764622bd87a770a70d0e4ba6f5ec08a3.tar.gz
nixlib-23585829764622bd87a770a70d0e4ba6f5ec08a3.tar.bz2
nixlib-23585829764622bd87a770a70d0e4ba6f5ec08a3.tar.lz
nixlib-23585829764622bd87a770a70d0e4ba6f5ec08a3.tar.xz
nixlib-23585829764622bd87a770a70d0e4ba6f5ec08a3.tar.zst
nixlib-23585829764622bd87a770a70d0e4ba6f5ec08a3.zip
Merge pull request #14045 from otwieracz/master
znapzend: added
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
+        '';
+      };
+    };
+
+  };
+}