zrepl: add package option to module (#179189)

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
Shawn8901 2022-07-10 20:32:27 +02:00 committed by GitHub
parent fb3672f9bd
commit 98ac43a1cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,6 +13,13 @@ in
services.zrepl = {
enable = mkEnableOption "zrepl";
package = mkOption {
type = types.package;
default = pkgs.zrepl;
defaultText = literalExpression "pkgs.zrepl";
description = "Which package to use for zrepl";
};
settings = mkOption {
default = { };
description = ''
@ -30,14 +37,14 @@ in
### Implementation ###
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.zrepl ];
environment.systemPackages = [ cfg.package ];
# zrepl looks for its config in this location by default. This
# allows the use of e.g. `zrepl signal wakeup <job>` without having
# to specify the storepath of the config.
environment.etc."zrepl/zrepl.yml".source = configFile;
systemd.packages = [ pkgs.zrepl ];
systemd.packages = [ cfg.package ];
# Note that pkgs.zrepl copies and adapts the upstream systemd unit, and
# the fields defined here only override certain fields from that unit.