ipfs-cluster configuration
This commit is contained in:
parent
db5a737339
commit
0878d1264d
9 changed files with 121 additions and 6 deletions
74
modules/ipfs/kubo.nix
Normal file
74
modules/ipfs/kubo.nix
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
{ config, ... }:
|
||||
let
|
||||
npins = import /etc/nixos/npins/default.nix;
|
||||
pkgs-unstable = import npins.nixpkgs-unstable { }; # TODO remove once kubo-0.43 is stable
|
||||
in
|
||||
{
|
||||
warnings = [
|
||||
"Ensure you added your primary user to the ipfs group !!!"
|
||||
];
|
||||
services.kubo = {
|
||||
autoMount = true;
|
||||
package = pkgs-unstable.kubo;
|
||||
enable = true;
|
||||
extraFlags = [
|
||||
"--mount-mfs"
|
||||
"/mfs"
|
||||
];
|
||||
settings = {
|
||||
Addresses.API = "/ip4/127.0.0.1/tcp/5001";
|
||||
|
||||
# Private-network (mesh network where everybody knows everybody) specific configuration
|
||||
# Not available in privated networks
|
||||
AutoTLS.Enabled = false;
|
||||
AutoConf.Enabled = false;
|
||||
Provide.Enabled = false;
|
||||
Swarm.AddrFilters = [
|
||||
];
|
||||
Swarm.Transports.Network.Websocket = false;
|
||||
|
||||
# Let's rely on tailscale MagicDNS
|
||||
DNS.Resolvers."." = "https://taila38157.ts.net";
|
||||
# We're in a private/closed network, no need to hide ourselves
|
||||
Addresses.NoAnnounce = [ ];
|
||||
|
||||
# Not needed since everybody knows everybody through peers.
|
||||
Routing.type = "none";
|
||||
Routing.DelegatedRouters = [ ];
|
||||
IPNS.DelegatedPublishers = [ ];
|
||||
|
||||
# Peers that I want to constantly connect to.
|
||||
# Less battery-intensive than the bootstrap nodes.
|
||||
Bootstrap = [ ];
|
||||
Peering.Peers = [
|
||||
{
|
||||
ID = "12D3KooWLW9Pms1H8KHMVnXTu8LtmnU29XDwvNmDbirGtDyKeiB6";
|
||||
Addrs = [ "/dns4/zomelab.taila38157.ts.net/tcp/4001" ];
|
||||
}
|
||||
{
|
||||
ID = "12D3KooWFVC9GmZqcYQNRiLfAmN8PjzdGE2yfMZZbbFpRaMtAKis";
|
||||
Addrs = [ "/dns4/niczos.taila38157.ts.net/tcp/4001" ];
|
||||
}
|
||||
];
|
||||
# End of private-network configuration
|
||||
|
||||
Discovery.MDNS.Enabled = false;
|
||||
Plugins.Plugins.telemetry.Config.Mode = "off";
|
||||
Datastore.StorageMax = "10G";
|
||||
};
|
||||
};
|
||||
# Private network key
|
||||
|
||||
# Firewall
|
||||
networking.firewall.interfaces."tailscale0".allowedTCPPorts = [
|
||||
4001
|
||||
];
|
||||
|
||||
sops.secrets.network-key = {
|
||||
sopsFile = /etc/nixos/modules/ipfs/keys/kubo-network-key.yaml;
|
||||
mode = "0060";
|
||||
owner = "nobody";
|
||||
group = config.services.kubo.group;
|
||||
path = "/var/lib/ipfs/swarm.key";
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue