summary refs log tree commit diff
path: root/nixos/modules/services/backup
diff options
context:
space:
mode:
authornyanloutre <paul@nyanlout.re>2018-05-24 23:35:53 +0200
committernyanloutre <paul@nyanlout.re>2018-06-09 00:34:13 +0200
commit20f6c5c865a488f339ac47346702dd4394facaf7 (patch)
treee6cec33ce62b4eb99149f836edc4fa73581d7728 /nixos/modules/services/backup
parent8d1eddea16a4f3d22b6f3c07c78a0960defa244d (diff)
downloadnixpkgs-20f6c5c865a488f339ac47346702dd4394facaf7.tar
nixpkgs-20f6c5c865a488f339ac47346702dd4394facaf7.tar.gz
nixpkgs-20f6c5c865a488f339ac47346702dd4394facaf7.tar.bz2
nixpkgs-20f6c5c865a488f339ac47346702dd4394facaf7.tar.lz
nixpkgs-20f6c5c865a488f339ac47346702dd4394facaf7.tar.xz
nixpkgs-20f6c5c865a488f339ac47346702dd4394facaf7.tar.zst
nixpkgs-20f6c5c865a488f339ac47346702dd4394facaf7.zip
nixos/duplicati: add port and interface options
Diffstat (limited to 'nixos/modules/services/backup')
-rw-r--r--nixos/modules/services/backup/duplicati.nix19
1 files changed, 18 insertions, 1 deletions
diff --git a/nixos/modules/services/backup/duplicati.nix b/nixos/modules/services/backup/duplicati.nix
index 9772ca4d20a..379fde1fe03 100644
--- a/nixos/modules/services/backup/duplicati.nix
+++ b/nixos/modules/services/backup/duplicati.nix
@@ -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";
       };
     };