diff options
author | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2022-05-07 02:40:37 +0900 |
---|---|---|
committer | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2022-05-07 02:40:37 +0900 |
commit | 04713bb59f5ddf7daa94555d23a527b31864d71a (patch) | |
tree | bf1b6a43ad7111ab35b08daabd908bd78170a6f6 | |
parent | 5df41fd81317983f53f91d5885e032bc0873b708 (diff) | |
download | nixos-conf-04713bb59f5ddf7daa94555d23a527b31864d71a.tar.gz |
Enable IPFS gateway
-rw-r--r-- | configuration.nix | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/configuration.nix b/configuration.nix index 0fa2b44..414af1a 100644 --- a/configuration.nix +++ b/configuration.nix @@ -52,20 +52,34 @@ in { }; services = { + ipfs = { + enable = true; + enableGC = true; + extraConfig.GateWay = { + NoFetch = true; + PublicGateways.${domain} = { + Paths = [ "/ipfs" "/ipns" ]; + UseSubdomains = true; + }; + }; + }; + nginx = { enable = true; + recommendedProxySettings = true; virtualHosts.${domain} = { enableACME = true; forceSSL = true; - root = "/var/www/${domain}"; + locations = let + ipfsGateway = "http://localhost:8080"; + in { + "/ipfs".proxyPass = ipfsGateway; + "/ipns".proxyPass = ipfsGateway; + }; + root = "/var/lib/www/${domain}"; }; }; - ipfs = { - enable = true; - enableGC = true; - }; - openssh = { enable = true; passwordAuthentication = false; |