mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
37 lines
611 B
Nix
37 lines
611 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 = ''
|
|
znapzend
|
|
'';
|
|
|
|
reload = ''
|
|
/bin/kill -HUP $MAINPID
|
|
'';
|
|
};
|
|
};
|
|
|
|
};
|
|
}
|