nixos/duplicati: add port and interface options

This commit is contained in:
nyanloutre 2018-05-24 23:35:53 +02:00
parent 8d1eddea16
commit 20f6c5c865
No known key found for this signature in database
GPG Key ID: F85D93686A3A9063

View File

@ -9,6 +9,23 @@ in
options = {
services.duplicati = {
enable = mkEnableOption "Duplicati";
port = mkOption {
default = 8200;
type = types.int;
description = ''
Port serving the web interface
'';
};
interface = mkOption {
default = "lo";
type = types.str;
description = ''
Listening interface for the web UI
Set it to "any" to listen on all available interfaces
'';
};
};
};
@ -22,7 +39,7 @@ in
serviceConfig = {
User = "duplicati";
Group = "duplicati";
ExecStart = "${pkgs.duplicati}/bin/duplicati-server --webservice-interface=any --webservice-port=8200 --server-datafolder=/var/lib/duplicati";
ExecStart = "${pkgs.duplicati}/bin/duplicati-server --webservice-interface=${cfg.interface} --webservice-port=${toString cfg.port} --server-datafolder=/var/lib/duplicati";
Restart = "on-failure";
};
};