nixos-config/modules/ipfs.nix

32 lines
804 B
Nix
Raw Normal View History

2022-02-13 03:41:57 +00:00
{ config, lib, pkgs, ... }:
let
cfg = config.sconfig.ipfs;
in
{
options.sconfig.ipfs = {
enable = lib.mkEnableOption "Turn on IPFS";
};
config = lib.mkIf cfg.enable {
services.ipfs = {
enable = true;
emptyRepo = true;
gatewayAddress = "/ip4/127.0.0.1/tcp/8001";
# Had issues without fdlimit. 65536 value taken from nixpkgs example
serviceFdlimit = 65536;
2022-02-18 03:58:04 +00:00
extraConfig = {
AutoNAT.ServiceMode = "disabled"; # maybe "enabled" for servers?
Routing.Type = "dhtclient"; # maybe "dht" for servers?
Swarm.DisableNatPortMap = true; # Disable UPnP
2022-05-06 20:54:30 +00:00
# ipfs-desktop defaults for ConnMgr
2022-06-15 02:27:25 +00:00
# Swarm.ConnMgr.GracePeriod = "1m";
2022-05-06 20:54:30 +00:00
Swarm.ConnMgr.HighWater = 40;
Swarm.ConnMgr.LowWater = 20;
2022-02-18 03:58:04 +00:00
};
2022-02-13 03:41:57 +00:00
};
};
}