From f33ac01f4a5a2007ce34ffa16d73cad985793491 Mon Sep 17 00:00:00 2001 From: James Walker Date: Mon, 21 Jun 2021 22:44:03 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=8A=20aristotle:=20ipfs=20nodes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hosts/aristotle/configuration.nix | 3 +++ modules/ipfs/default.nix | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 modules/ipfs/default.nix diff --git a/hosts/aristotle/configuration.nix b/hosts/aristotle/configuration.nix index c7435f2..1311b41 100644 --- a/hosts/aristotle/configuration.nix +++ b/hosts/aristotle/configuration.nix @@ -4,6 +4,8 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix ./rpi-poe.nix + + ../../modules/ipfs ]; # Use the extlinux boot loader. (NixOS wants to enable GRUB by default) @@ -26,6 +28,7 @@ networking.useDHCP = false; networking.interfaces.eth0.useDHCP = true; networking.interfaces.wlan0.useDHCP = true; + networking.firewall.enable = false; # Enable the OpenSSH daemon. services.openssh.enable = true; diff --git a/modules/ipfs/default.nix b/modules/ipfs/default.nix new file mode 100644 index 0000000..843fe3a --- /dev/null +++ b/modules/ipfs/default.nix @@ -0,0 +1,22 @@ +{ config, lib, pkgs, ... }: + +{ + services = { + ipfs = { + enable = true; + apiAddress = "/ip4/0.0.0.0/tcp/5001"; + gatewayAddress = "/ip4/0.0.0.0/tcp/8080"; + swarmAddress = [ + "/ip4/0.0.0.0/tcp/4001" + "/ip6/::/tcp/4001" + "/ip4/0.0.0.0/udp/4001/quic" + "/ip6/::/udp/4001/quic" + "/ip4/0.0.0.0/tcp/4002/ws" + "/ip6/::1/tcp/4002/ws" + ]; + extraConfig = { + API = { HTTPHeaders = { Access-Control-Allow-Origin = [ "*" ]; }; }; + }; + }; + }; +}