summary refs log tree commit diff
path: root/nixos/modules/services/network-filesystems
diff options
context:
space:
mode:
authorSebastian Jordan <sebastian.jordan.mail@googlemail.com>2018-05-23 16:44:31 +0200
committerSebastian Jordan <sebastian.jordan.mail@googlemail.com>2018-05-23 16:44:31 +0200
commit2009c76a665435f706a27768d8dba69736ae1282 (patch)
tree971808e7ede0cbbb43a3b26e29dff4058bf927a8 /nixos/modules/services/network-filesystems
parent1bf798b8cb1da83ebedf408115590d3d002e3609 (diff)
downloadnixlib-2009c76a665435f706a27768d8dba69736ae1282.tar
nixlib-2009c76a665435f706a27768d8dba69736ae1282.tar.gz
nixlib-2009c76a665435f706a27768d8dba69736ae1282.tar.bz2
nixlib-2009c76a665435f706a27768d8dba69736ae1282.tar.lz
nixlib-2009c76a665435f706a27768d8dba69736ae1282.tar.xz
nixlib-2009c76a665435f706a27768d8dba69736ae1282.tar.zst
nixlib-2009c76a665435f706a27768d8dba69736ae1282.zip
nixos/ipfs: Improve behavior of localDiscovery option
It is no longer required to change the config your ipfs repo manually if you change
localDiscovery option in nixos configuration after ipfs repository initialization.
Diffstat (limited to 'nixos/modules/services/network-filesystems')
-rw-r--r--nixos/modules/services/network-filesystems/ipfs.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/nixos/modules/services/network-filesystems/ipfs.nix b/nixos/modules/services/network-filesystems/ipfs.nix
index b5903d113c57..ab6d3a3d2fa4 100644
--- a/nixos/modules/services/network-filesystems/ipfs.nix
+++ b/nixos/modules/services/network-filesystems/ipfs.nix
@@ -189,9 +189,7 @@ in {
       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.
+          This will allow ipfs to scan ports on your local network. Some hosting services will ban you if you do this.
         '';
         default = true;
       };
@@ -244,6 +242,11 @@ in {
         if [[ ! -f ${cfg.dataDir}/config ]]; then
           ipfs init ${optionalString cfg.emptyRepo "-e"} \
             ${optionalString (! cfg.localDiscovery) "--profile=server"}
+        else
+          ${if cfg.localDiscovery
+            then "ipfs config profile apply local-discovery"
+            else "ipfs config profile apply server"
+          }
         fi
       '';