1 { config, pkgs, lib, host, hostName, ... }:
3 inherit (config.networking) domain;
5 radicle = config.services.radicle;
6 seed = "${srv}-${hostName}.${domain}";
11 privateKeyFile = "key:${radicle/key.cred}";
12 publicKeyFile = radicle/key.pub;
13 #package = pkgs.radicle-node;
15 # FIXME: because radicle-node from the heartwood's flake.nix does not include rad
16 # Should be re-enabled once radicle-node comes from Nixpkgs
20 package = pkgs.radicle-httpd;
28 error_log /var/log/nginx/${domain}/${srv}-${hostName}/error.log warn;
34 "z6MkrLMMsiPWUcNPHcRajuMi9mDfYckSoJyPwwnknocNYPm7@seed.radicle.garden:8776"
35 #"z6Mkmqogy2qEM2ummccUthFEaaHvyYmYBYh3dbe9W4ebScxo@ash.radicle.garden:8776"
37 publicExplorer = "https://${srv}.${domain}/nodes/$host/$rid$path";
41 # Relaying produces a constant network stream!
43 # Make this a public node
44 #externalAddresses = [
45 # "${seed}:${toString radicle.node.listenPort}"
46 # #"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.onion:${toString radicle.node.listenPort}"
53 routingMaxSize = 1000;
54 routingMaxAge = 1 * 7 * 24 * 60 * 60; # 1 week
55 gossipMaxAge = 1 * 7 * 24 * 60 * 60; # 1 week
77 address = "127.0.0.1:9050";
83 # Pinned repositories must be `rad clone`-d before.
85 "rad:z2364hmzZUAGy1nKdSFa1gLSoUE2M" # literate-phylomemy
86 "rad:z3795BqJN8hSMGkyAUr8hHviEEi2H" # logic
87 "rad:z4NtwMC1GmUuCRLngaZrVrSZLmUvh" # symantic-base
93 systemd.services.radicle-node = {
94 environment.RUST_LOG = "debug";
99 MemoryAccounting = true;
102 CPUSchedulingPolicy = "idle";
103 IOSchedulingClass = "idle";
104 # 0: high priority, 7: low priority
105 IOSchedulingPriority = 3;
109 services.sanoid.datasets."rpool/var/lib/${srv}" = {
110 use_template = [ "snap" ];
116 environment.systemPackages = [
120 networking.nftables.ruleset = ''
123 tcp dport ${toString radicle.node.listenPort} counter accept comment "radicle-node"
125 chain input-neb-sourcephile {
126 tcp dport ${toString radicle.node.listenPort} counter accept comment "radicle-node"
129 skuid @nixos_radicle_node_uids meta l4proto tcp counter accept comment "radicle-node"
134 services.nginx.virtualHosts."${srv}-explorer.${domain}" = {
135 serverAliases = [ "${srv}.${domain}" ];
137 useACMEHost = domain;
140 error_log /var/log/nginx/${domain}/${srv}-explorer/error.log warn;
144 try_files $uri $uri/ /index.html;
146 index = "index.html";
147 root = pkgs.radicle-explorer.overrideAttrs (previousAttrs: {
148 postPatch = (previousAttrs.postPatch or "") + ''
149 cp ${pkgs.writeText "local.json" ''
152 "fallbackPublicExplorer": "https://app.radicle.xyz/nodes/$host/$rid$path",
153 "defaultHttpdPort": 443,
154 "defaultLocalHttpdPort": 8080,
155 "defaultHttpdHostname": "localhost",
156 "defaultHttpdScheme": "https",
157 "defaultNodePort": 8776,
161 "hostname": "${seed}",
168 "supportWebsite": "https://radicle.zulipchat.com",
169 "reactions": ["👍", "👎", "😄", "🙁", "👀"],
170 "fallbackPreferredSeed": {
171 "hostname": "${seed}",
176 ''} config/local.json
181 systemd.services.nginx.serviceConfig.LogsDirectory = lib.mkForce [
182 "nginx/${domain}/${srv}-${hostName}"
183 "nginx/${domain}/${srv}-explorer"