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 {
21 dest = "zrepl/zrepl.yml";
24 user = config.systemd.services.zrepl.serviceConfig.User or "root";
25 group = config.systemd.services.zrepl.serviceConfig.Group or "root";
28 services.filesWatcher.zrepl = {
30 paths = [ config.secrets.fullPaths."zrepl/zrepl.yml" ];
32 systemd.services.zrepl = {
33 description = "zrepl daemon";
34 wantedBy = [ "multi-user.target" ];
35 path = [ pkgs.zfs pkgs.openssh ];
38 let configFile = config.secrets.fullPaths."zrepl/zrepl.yml";
39 in "${pkgs.zrepl}/bin/zrepl daemon --config ${configFile}";
41 RuntimeDirectory= "zrepl";
42 RuntimeDirectoryMode= "0700";