2022-11-14 01:01:09 +02:00
|
|
|
{ config, lib, tools, ... }:
|
2022-10-19 21:25:19 +03:00
|
|
|
|
|
|
|
{
|
2022-11-14 01:01:09 +02:00
|
|
|
hostLinks = lib.genAttrs config.services.ipfs.nodes.node (name: let
|
|
|
|
host = config.vars.hosts.${name};
|
|
|
|
intf = host.interfaces.primary;
|
|
|
|
self = config.hostLinks.${name}.ipfs;
|
|
|
|
in {
|
|
|
|
ipfs = {
|
|
|
|
ipv4 = if intf ? addrPublic then intf.addrPublic else intf.addr;
|
|
|
|
port = 4001;
|
|
|
|
extra = {
|
|
|
|
peerId = {
|
|
|
|
VEGAS = "Qmd7QHZU8UjfYdwmjmq1SBh9pvER9AwHpfwQvnvNo3HBBo";
|
|
|
|
prophet = "12D3KooWQWsHPUUeFhe4b6pyCaD1hBoj8j6Z7S7kTznRTh1p1eVt";
|
|
|
|
}.${name};
|
2022-11-14 01:49:38 +02:00
|
|
|
multiaddrs = [
|
|
|
|
"/ip4/${self.ipv4}/udp/${self.portStr}/quic"
|
|
|
|
"/ip4/${self.ipv4}/tcp/${self.portStr}"
|
|
|
|
];
|
2022-11-14 01:01:09 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
2022-10-19 21:25:19 +03:00
|
|
|
services.ipfs = {
|
|
|
|
nodes = {
|
|
|
|
node = [ "VEGAS" "prophet" ];
|
2022-10-20 01:08:12 +03:00
|
|
|
clusterPeer = [ "VEGAS" "prophet" ];
|
2022-10-19 21:25:19 +03:00
|
|
|
gateway = [ "VEGAS" ];
|
|
|
|
};
|
|
|
|
nixos = {
|
|
|
|
node = [
|
|
|
|
./node.nix
|
|
|
|
];
|
|
|
|
gateway = [
|
|
|
|
./gateway.nix
|
|
|
|
./monitoring.nix
|
|
|
|
];
|
2022-10-20 01:08:12 +03:00
|
|
|
clusterPeer = [
|
|
|
|
./cluster.nix
|
|
|
|
];
|
2022-10-19 21:25:19 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|