Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { config, lib, pkgs, ... }:
- with lib;
- let
- cfg = config.services.zrepl;
- in
- {
- ###### interface
- options = {
- services.zrepl = {
- enable = mkOption {
- type = types.bool;
- default = true;
- description = "Whether to enable the zrepl daemon.";
- };
- config = mkOption {
- type = types.lines;
- default = "";
- description = "Configuration to use for zrepl aemon.";
- };
- };
- };
- ###### implementation
- config = mkIf cfg.enable {
- environment.etc."zrepl.yml".text = cfg.config;
- systemd.services.zrepl =
- { description = "zrepl daemon";
- wantedBy = [ "multi-user.target" ];
- restartTriggers = [
- config.environment.etc."zrepl.yml".source
- ];
- serviceConfig =
- { ExecStart = "${pkgs.zrepl}/bin/zrepl daemon --config /etc/zrepl.yml";
- Type = "simple";
- RuntimeDirectory= "zrepl";
- RuntimeDirectoryMode= "0700";
- };
- };
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement