git.iko.soy/typeable/nixpkgs
on master help sign in
ipfs: add swarmAddress option
commitd0b9d13618a6571f3afe56b5296529f0aa3a0e48 authorEric Litak <elitak@gmail.com> dateSat 25 Nov 2017, 22:47 (9 years ago) parentd1c525b
1 file changed+11−3
nixos/modules/services/network-filesystems/ipfs.nix+11−3
nixos/modules/services/network-filesystems/ipfs.nix+11−3
@@ -39,8 +39,6 @@ let
3939 # NB: migration must be performed prior to pre-start, else we get the failure message!
4040 preStart = ''
4141 ipfs repo fsck # workaround for BUG #4212 (https://github.com/ipfs/go-ipfs/issues/4214)
42− ipfs --local config Addresses.API ${cfg.apiAddress}
43− ipfs --local config Addresses.Gateway ${cfg.gatewayAddress}
4442 '' + optionalString cfg.autoMount ''
4543 ipfs --local config Mounts.FuseAllowOther --json true
4644 ipfs --local config Mounts.IPFS ${cfg.ipfsMountDir}
@@ -56,7 +54,11 @@ let
5654 EOF
5755 ipfs --local config --json "${concatStringsSep "." path}" "$value"
5856 '')
59− cfg.extraConfig)
57+ ({ Addresses.API = cfg.apiAddress;
58+ Addresses.Gateway = cfg.gatewayAddress;
59+ Addresses.Swarm = cfg.swarmAddress;
60+ } //
61+ cfg.extraConfig))
6062 );
6163 serviceConfig = {
6264 ExecStart = "${wrapped}/bin/ipfs daemon ${ipfsFlags}";
@@ -140,6 +142,12 @@ in {
140142 description = "Where IPFS exposes its API to";
141143 };
142144
145+ swarmAddress = mkOption {
146+ type = types.listOf types.str;
147+ default = [ "/ip4/0.0.0.0/tcp/4001" "/ip6/::/tcp/4001" ];
148+ description = "Where IPFS listens for incoming p2p connections";
149+ };
150+
143151 enableGC = mkOption {
144152 type = types.bool;
145153 default = false;