diff options
author | Eric Litak <elitak@gmail.com> | 2017-11-25 22:47:59 -0800 |
---|---|---|
committer | Eric Litak <elitak@gmail.com> | 2017-11-25 22:56:07 -0800 |
commit | d0b9d13618a6571f3afe56b5296529f0aa3a0e48 (patch) | |
tree | 3fea081c98d6a95728007f73d7728a13a590c318 /nixos/modules/services/network-filesystems | |
parent | d1c525bc49d8cd6d16e746012c599ce972a2d993 (diff) | |
download | nixlib-d0b9d13618a6571f3afe56b5296529f0aa3a0e48.tar nixlib-d0b9d13618a6571f3afe56b5296529f0aa3a0e48.tar.gz nixlib-d0b9d13618a6571f3afe56b5296529f0aa3a0e48.tar.bz2 nixlib-d0b9d13618a6571f3afe56b5296529f0aa3a0e48.tar.lz nixlib-d0b9d13618a6571f3afe56b5296529f0aa3a0e48.tar.xz nixlib-d0b9d13618a6571f3afe56b5296529f0aa3a0e48.tar.zst nixlib-d0b9d13618a6571f3afe56b5296529f0aa3a0e48.zip |
ipfs: add swarmAddress option
Diffstat (limited to 'nixos/modules/services/network-filesystems')
-rw-r--r-- | nixos/modules/services/network-filesystems/ipfs.nix | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/nixos/modules/services/network-filesystems/ipfs.nix b/nixos/modules/services/network-filesystems/ipfs.nix index d4a695ef5880..39a4fd6beff8 100644 --- a/nixos/modules/services/network-filesystems/ipfs.nix +++ b/nixos/modules/services/network-filesystems/ipfs.nix @@ -39,8 +39,6 @@ let # 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} @@ -56,7 +54,11 @@ let 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}"; @@ -140,6 +142,12 @@ in { 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 { type = types.bool; default = false; |