nixos/duplicati: add package option
This commit is contained in:
parent
9310806eb6
commit
42f0af4abe
|
@ -10,6 +10,8 @@ in
|
|||
services.duplicati = {
|
||||
enable = mkEnableOption (lib.mdDoc "Duplicati");
|
||||
|
||||
package = mkPackageOptionMD pkgs "duplicati" { };
|
||||
|
||||
port = mkOption {
|
||||
default = 8200;
|
||||
type = types.port;
|
||||
|
@ -53,7 +55,7 @@ in
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ pkgs.duplicati ];
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
|
||||
systemd.services.duplicati = {
|
||||
description = "Duplicati backup";
|
||||
|
@ -63,7 +65,7 @@ in
|
|||
{
|
||||
User = cfg.user;
|
||||
Group = "duplicati";
|
||||
ExecStart = "${pkgs.duplicati}/bin/duplicati-server --webservice-interface=${cfg.interface} --webservice-port=${toString cfg.port} --server-datafolder=${cfg.dataDir}";
|
||||
ExecStart = "${cfg.package}/bin/duplicati-server --webservice-interface=${cfg.interface} --webservice-port=${toString cfg.port} --server-datafolder=${cfg.dataDir}";
|
||||
Restart = "on-failure";
|
||||
}
|
||||
(mkIf (cfg.dataDir == "/var/lib/duplicati") {
|
||||
|
@ -83,4 +85,3 @@ in
|
|||
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue