ipfs: add swarmAddress option

Changed files
+11 -3
nixos
modules
services
network-filesystems
+11 -3
nixos/modules/services/network-filesystems/ipfs.nix
···
# NB: migration must be performed prior to pre-start, else we get the failure message!
preStart = ''
ipfs repo fsck # workaround for BUG #4212 (https://github.com/ipfs/go-ipfs/issues/4214)
-
ipfs --local config Addresses.API ${cfg.apiAddress}
-
ipfs --local config Addresses.Gateway ${cfg.gatewayAddress}
'' + optionalString cfg.autoMount ''
ipfs --local config Mounts.FuseAllowOther --json true
ipfs --local config Mounts.IPFS ${cfg.ipfsMountDir}
···
EOF
ipfs --local config --json "${concatStringsSep "." path}" "$value"
'')
-
cfg.extraConfig)
+
({ Addresses.API = cfg.apiAddress;
+
Addresses.Gateway = cfg.gatewayAddress;
+
Addresses.Swarm = cfg.swarmAddress;
+
} //
+
cfg.extraConfig))
);
serviceConfig = {
ExecStart = "${wrapped}/bin/ipfs daemon ${ipfsFlags}";
···
type = types.str;
default = "/ip4/127.0.0.1/tcp/5001";
description = "Where IPFS exposes its API to";
+
};
+
+
swarmAddress = mkOption {
+
type = types.listOf types.str;
+
default = [ "/ip4/0.0.0.0/tcp/4001" "/ip6/::/tcp/4001" ];
+
description = "Where IPFS listens for incoming p2p connections";
};
enableGC = mkOption {