1 { config, pkgs, lib, host, hostName, ... }:
3 inherit (config.networking) domain;
4 inherit (config.users) users;
6 radicle = config.services.radicle;
7 seed = "${srv}-${hostName}.${domain}";
12 privateKeyFile = "key:${radicle/key.cred}";
13 publicKeyFile = radicle/key.pub;
14 #package = pkgs.radicle-node;
16 # FIXME: because radicle-node from the heartwood's flake.nix does not include rad
17 # Should be re-enabled once radicle-node comes from Nixpkgs
21 package = pkgs.radicle-httpd;
29 error_log /var/log/nginx/${domain}/${srv}-${hostName}/error.log warn;
35 "z6MkrLMMsiPWUcNPHcRajuMi9mDfYckSoJyPwwnknocNYPm7@seed.radicle.garden:8776"
36 #"z6Mkmqogy2qEM2ummccUthFEaaHvyYmYBYh3dbe9W4ebScxo@ash.radicle.garden:8776"
38 publicExplorer = "https://${srv}.${domain}/nodes/$host/$rid$path";
42 # Relaying produces a constant network stream!
44 # Make this a public node
45 #externalAddresses = [
46 # "${seed}:${toString radicle.node.listenPort}"
47 # #"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.onion:${toString radicle.node.listenPort}"
54 routingMaxSize = 1000;
55 routingMaxAge = 1 * 7 * 24 * 60 * 60; # 1 week
56 gossipMaxAge = 1 * 7 * 24 * 60 * 60; # 1 week
78 address = "127.0.0.1:9050";
84 # Pinned repositories must be `rad clone`-d before.
86 "rad:z2364hmzZUAGy1nKdSFa1gLSoUE2M" # literate-phylomemy
87 "rad:z3795BqJN8hSMGkyAUr8hHviEEi2H" # logic
88 "rad:z4NtwMC1GmUuCRLngaZrVrSZLmUvh" # symantic-base
94 systemd.services.radicle-node = {
95 environment.RUST_LOG = "debug";
100 MemoryAccounting = true;
103 CPUSchedulingPolicy = "idle";
104 IOSchedulingClass = "idle";
105 # 0: high priority, 7: low priority
106 IOSchedulingPriority = 3;
110 services.sanoid.datasets."rpool/var/lib/${srv}" = {
111 use_template = [ "snap" ];
117 environment.systemPackages = [
121 networking.nftables.ruleset = ''
124 tcp dport ${toString radicle.node.listenPort} counter accept comment "radicle-node"
126 chain input-neb-sourcephile {
127 tcp dport ${toString radicle.node.listenPort} counter accept comment "radicle-node"
130 skuid ${users.radicle.name} meta l4proto tcp counter accept comment "radicle-node"
135 services.nginx.virtualHosts."${srv}-explorer.${domain}" = {
136 serverAliases = [ "${srv}.${domain}" ];
138 useACMEHost = domain;
141 error_log /var/log/nginx/${domain}/${srv}-explorer/error.log warn;
145 try_files $uri $uri/ /index.html;
147 index = "index.html";
148 root = pkgs.radicle-explorer.overrideAttrs (previousAttrs: {
149 postPatch = (previousAttrs.postPatch or "") + ''
150 cp ${pkgs.writeText "local.json" ''
153 "fallbackPublicExplorer": "https://app.radicle.xyz/nodes/$host/$rid$path",
154 "defaultHttpdPort": 443,
155 "defaultLocalHttpdPort": 8080,
156 "defaultHttpdHostname": "localhost",
157 "defaultHttpdScheme": "https",
158 "defaultNodePort": 8776,
162 "hostname": "${seed}",
169 "supportWebsite": "https://radicle.zulipchat.com",
170 "reactions": ["👍", "👎", "😄", "🙁", "👀"],
171 "fallbackPreferredSeed": {
172 "hostname": "${seed}",
177 ''} config/local.json
182 systemd.services.nginx.serviceConfig.LogsDirectory = lib.mkForce [
183 "nginx/${domain}/${srv}-${hostName}"
184 "nginx/${domain}/${srv}-explorer"