2016-03-24 09:52:13 +00:00
|
|
|
{ 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";
|
2017-05-15 14:09:50 +01:00
|
|
|
wantedBy = [ "zfs.target" ];
|
2016-03-24 09:52:13 +00:00
|
|
|
after = [ "zfs.target" ];
|
|
|
|
|
2017-04-19 12:56:51 +01:00
|
|
|
path = with pkgs; [ zfs mbuffer openssh ];
|
2016-03-24 09:52:13 +00:00
|
|
|
|
2017-04-19 12:56:51 +01:00
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${pkgs.znapzend}/bin/znapzend";
|
|
|
|
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
|
|
|
};
|
2016-03-24 09:52:13 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|