X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=blobdiff_plain;f=modules%2Fzrepl.nix;fp=modules%2Fzrepl.nix;h=0000000000000000000000000000000000000000;hp=5bcc17b638bd31c29dbfe4d30a35f62964f8a68e;hb=1a64deeb894dc95e2645a75771732c6cc53a79ad;hpb=fa25ffd4583cc362075cd5e1b4130f33306103f0 diff --git a/modules/zrepl.nix b/modules/zrepl.nix deleted file mode 100644 index 5bcc17b..0000000 --- a/modules/zrepl.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ config, lib, pkgs, ... }: -let - cfg = config.services.zrepl; -in -{ - options = { - services.zrepl = { - enable = lib.mkEnableOption "Enable the zrepl daemon"; - - config = lib.mkOption { - type = lib.types.lines; - default = ""; - description = "Configuration"; - }; - }; - }; - - config = lib.mkIf cfg.enable { - secrets.keys = { - "zrepl/zrepl.yml" = { - permissions = "0400"; - text = cfg.config; - user = config.systemd.services.zrepl.serviceConfig.User or "root"; - group = config.systemd.services.zrepl.serviceConfig.Group or "root"; - }; - }; - services.filesWatcher.zrepl = { - restart = true; - paths = [ config.secrets.fullPaths."zrepl/zrepl.yml" ]; - }; - systemd.services.zrepl = { - description = "zrepl daemon"; - wantedBy = [ "multi-user.target" ]; - path = [ pkgs.zfs pkgs.openssh ]; - serviceConfig = { - ExecStart = - let configFile = config.secrets.fullPaths."zrepl/zrepl.yml"; - in "${pkgs.zrepl}/bin/zrepl daemon --config ${configFile}"; - Type = "simple"; - RuntimeDirectory= "zrepl"; - RuntimeDirectoryMode= "0700"; - }; - }; - }; -}