diff options
author | Sebastian Jordan <sebastian.jordan.mail@googlemail.com> | 2018-05-21 14:15:58 +0200 |
---|---|---|
committer | Sebastian Jordan <sebastian.jordan.mail@googlemail.com> | 2018-05-21 14:16:47 +0200 |
commit | 1bf798b8cb1da83ebedf408115590d3d002e3609 (patch) | |
tree | 5c666739c22ad01ab3c441e27a64ba49640d0ef3 /nixos/modules/services/network-filesystems | |
parent | a48088769f1c5f68b11bbd3a21b4b18b3e3d2765 (diff) | |
download | nixlib-1bf798b8cb1da83ebedf408115590d3d002e3609.tar nixlib-1bf798b8cb1da83ebedf408115590d3d002e3609.tar.gz nixlib-1bf798b8cb1da83ebedf408115590d3d002e3609.tar.bz2 nixlib-1bf798b8cb1da83ebedf408115590d3d002e3609.tar.lz nixlib-1bf798b8cb1da83ebedf408115590d3d002e3609.tar.xz nixlib-1bf798b8cb1da83ebedf408115590d3d002e3609.tar.zst nixlib-1bf798b8cb1da83ebedf408115590d3d002e3609.zip |
nixos/ipfs: Add option to disable local port scanning for ipfs daemon
Diffstat (limited to 'nixos/modules/services/network-filesystems')
-rw-r--r-- | nixos/modules/services/network-filesystems/ipfs.nix | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/nixos/modules/services/network-filesystems/ipfs.nix b/nixos/modules/services/network-filesystems/ipfs.nix index e2122ddb8ede..b5903d113c57 100644 --- a/nixos/modules/services/network-filesystems/ipfs.nix +++ b/nixos/modules/services/network-filesystems/ipfs.nix @@ -186,6 +186,16 @@ in { default = []; }; + localDiscovery = mkOption { + type = types.bool; + description = ''Whether to enable local discovery for the ipfs daemon. + This will prevent ipfs to scan ports on your local network. Some hosting services will ban you if you do. + + This option only has an effect before you initialized ipfs your machine. + ''; + default = true; + }; + serviceFdlimit = mkOption { type = types.nullOr types.int; default = null; @@ -232,7 +242,8 @@ in { ''; script = '' if [[ ! -f ${cfg.dataDir}/config ]]; then - ipfs init ${optionalString cfg.emptyRepo "-e"} + ipfs init ${optionalString cfg.emptyRepo "-e"} \ + ${optionalString (! cfg.localDiscovery) "--profile=server"} fi ''; |