This repository has no description
2.5 kB
63 lines
1{ ... }:
2{
3 # Full kubo (IPFS) node. Data lives under /var/lib/ipfs on the 4 TB root.
4 # Uploads are copied into the blockstore (NO filestore/--nocopy on this host).
5 services.kubo = {
6 enable = true;
7 dataDir = "/var/lib/ipfs";
8 # No automatic GC: content is pinned on upload and only reclaimed by the
9 # explicit `ipfs-gc` command (see ipfs-endpoint.nix).
10 settings = {
11 Addresses = {
12 API = [ "/ip4/127.0.0.1/tcp/5001" ];
13 Gateway = [ "/ip4/127.0.0.1/tcp/8089" ];
14 };
15 # Serve only local/pinned blocks -> the public gateway is not an open
16 # proxy for arbitrary network CIDs.
17 Gateway.NoFetch = true;
18 Datastore.StorageMax = "500GB";
19
20 # Make the pins reachable through the public gateways, the way the
21 # old node (configs/services/flix/ipfs.nix) was. Measured before
22 # this block with ipfs-check against a pinned CID: DHT provider
23 # record present, bitswap answering, IPNI record ABSENT -- and every
24 # public gateway 504ing on anything larger than a single block,
25 # since walking a DAG block by block over bitswap from one peer does
26 # not fit their ~30 s request budget.
27 #
28 # autoclient = DHT client plus IPNI (cid.contact) announcements; the
29 # gateways resolve providers through IPNI and can then pull content
30 # in bulk. Provide.Strategy pinned keeps the announcements to what
31 # is meant to be served; the nixpkgs module's default Reprovider
32 # block is the pre-0.40 name and must be nulled or kubo refuses to
33 # start.
34 Routing.Type = "autoclient";
35 Reprovider = null;
36 Provide = {
37 Strategy = "pinned";
38 DHT.Interval = "12h";
39 };
40
41 # Room for the gateways' parallel block requests: a 3.9 GB tree is
42 # ~15,000 blocks and a gateway fetching one opens many streams.
43 Swarm.ConnMgr = {
44 LowWater = 100;
45 HighWater = 400;
46 GracePeriod = "20s";
47 };
48 Swarm.ResourceMgr = {
49 Enabled = true;
50 MaxMemory = "2GB";
51 };
52 Swarm.Transports.Network.TCP = true;
53 Swarm.Transports.Network.QUIC = true;
54 # No relaying for others; this node has a public address.
55 Swarm.RelayClient.Enabled = false;
56 Swarm.RelayService.Enabled = false;
57 };
58 };
59
60 # incoming swarm connections (TCP + QUIC/UDP on 4001)
61 networking.firewall.allowedTCPPorts = [ 4001 ];
62 networking.firewall.allowedUDPPorts = [ 4001 ];
63}