summary refs log tree commit diff
path: root/nixos/modules/services/network-filesystems/tahoe.nix
diff options
context:
space:
mode:
authorCorbin <cds@corbinsimpson.com>2016-04-02 11:34:49 -0700
committerCorbin <cds@corbinsimpson.com>2016-04-12 18:44:25 -0700
commitd5c9a80ccddb62d1036794458c7c032bd5f5b0c8 (patch)
tree507f6ba2502a2d19c9573c22f1e8d67943d64bfe /nixos/modules/services/network-filesystems/tahoe.nix
parent052b9ec3b5362de40e66736cf688ff4843b12e5d (diff)
downloadnixlib-d5c9a80ccddb62d1036794458c7c032bd5f5b0c8.tar
nixlib-d5c9a80ccddb62d1036794458c7c032bd5f5b0c8.tar.gz
nixlib-d5c9a80ccddb62d1036794458c7c032bd5f5b0c8.tar.bz2
nixlib-d5c9a80ccddb62d1036794458c7c032bd5f5b0c8.tar.lz
nixlib-d5c9a80ccddb62d1036794458c7c032bd5f5b0c8.tar.xz
nixlib-d5c9a80ccddb62d1036794458c7c032bd5f5b0c8.tar.zst
nixlib-d5c9a80ccddb62d1036794458c7c032bd5f5b0c8.zip
services/tahoe: Add tub.location for specifying external IPs.
Invaluable for wiring up clouds.
Diffstat (limited to 'nixos/modules/services/network-filesystems/tahoe.nix')
-rw-r--r--nixos/modules/services/network-filesystems/tahoe.nix25
1 files changed, 25 insertions, 0 deletions
diff --git a/nixos/modules/services/network-filesystems/tahoe.nix b/nixos/modules/services/network-filesystems/tahoe.nix
index ab441339a560..d4b6c05e9432 100644
--- a/nixos/modules/services/network-filesystems/tahoe.nix
+++ b/nixos/modules/services/network-filesystems/tahoe.nix
@@ -26,6 +26,15 @@ in
               The port on which the introducer will listen.
             '';
           };
+          tub.location = mkOption {
+            default = null;
+            type = types.nullOr types.str;
+            description = ''
+              The external location that the introducer should listen on.
+
+              If specified, the port should be included.
+            '';
+          };
           package = mkOption {
             default = pkgs.tahoelafs;
             defaultText = "pkgs.tahoelafs";
@@ -60,6 +69,18 @@ in
               system to listen on a different port.
             '';
           };
+          tub.location = mkOption {
+            default = null;
+            type = types.nullOr types.str;
+            description = ''
+              The external location that the node should listen on.
+
+              This is the setting to tweak if there are multiple interfaces
+              and you want to alter which interface Tahoe is advertising.
+
+              If specified, the port should be included.
+            '';
+          };
           web.port = mkOption {
             default = 3456;
             type = types.int;
@@ -144,6 +165,8 @@ in
                 [node]
                 nickname = ${settings.nickname}
                 tub.port = ${toString settings.tub.port}
+                ${optionalString (settings.tub.location != null)
+                  "tub.location = ${settings.tub.location}"}
               '';
             });
           # Actually require Tahoe, so that we will have it installed.
@@ -209,6 +232,8 @@ in
                 [node]
                 nickname = ${settings.nickname}
                 tub.port = ${toString settings.tub.port}
+                ${optionalString (settings.tub.location != null)
+                  "tub.location = ${settings.tub.location}"}
                 # This is a Twisted endpoint. Twisted Web doesn't work on
                 # non-TCP. ~ C.
                 web.port = tcp:${toString settings.web.port}