nixpkgs/nixos/modules/services/backup/znapzend.nix
2017-04-19 01:05:55 +02:00

36 lines
633 B
Nix

{ 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 = ''
exec znapzend
'';
reload = ''
${pkgs.coreutils}/bin/kill -HUP $MAINPID
'';
};
};
};
}