1 { config, lib, pkgs, ... }:
3 cfg = config.services.zrepl;
8 enable = lib.mkEnableOption "Enable the zrepl daemon";
10 config = lib.mkOption {
11 type = lib.types.lines;
13 description = "Configuration";
18 config = lib.mkIf cfg.enable {
23 user = config.systemd.services.zrepl.serviceConfig.User or "root";
24 group = config.systemd.services.zrepl.serviceConfig.Group or "root";
27 services.filesWatcher.zrepl = {
29 paths = [ config.secrets.fullPaths."zrepl/zrepl.yml" ];
31 systemd.services.zrepl = {
32 description = "zrepl daemon";
33 wantedBy = [ "multi-user.target" ];
34 path = [ pkgs.zfs pkgs.openssh ];
37 let configFile = config.secrets.fullPaths."zrepl/zrepl.yml";
38 in "${pkgs.zrepl}/bin/zrepl daemon --config ${configFile}";
40 RuntimeDirectory= "zrepl";
41 RuntimeDirectoryMode= "0700";