10 inherit (config.networking) domain;
11 inherit (config.users) users;
13 radicle = config.services.radicle;
14 seed = "${srv}-${hostName}.${domain}";
16 haskell-miso-nix-demo = "rad:z2BeGZUdNCY3FzYarKMV7XXXuc5os";
17 heartwood = "rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5";
18 literate-phylomemy = "rad:z2364hmzZUAGy1nKdSFa1gLSoUE2M";
19 logic = "rad:z3795BqJN8hSMGkyAUr8hHviEEi2H";
20 symantic-base = "rad:z4NtwMC1GmUuCRLngaZrVrSZLmUvh";
26 privateKeyFile = "key:${radicle/key.cred}";
27 publicKey = radicle/key.pub;
28 #package = pkgs.radicle-node;
30 # FIXME: because radicle-node from the heartwood's flake.nix does not include rad
31 # Should be re-enabled once radicle-node comes from Nixpkgs
35 package = pkgs.radicle-httpd;
43 error_log /var/log/nginx/${domain}/${srv}-${hostName}/error.log warn;
46 # UsabilitySelfDescriptivenessToDo: needs nixos-25.11
47 #aliases = repositories;
51 "z6MkrLMMsiPWUcNPHcRajuMi9mDfYckSoJyPwwnknocNYPm7@seed.radicle.garden:8776"
52 #"z6Mkmqogy2qEM2ummccUthFEaaHvyYmYBYh3dbe9W4ebScxo@ash.radicle.garden:8776"
54 publicExplorer = "https://${srv}.${domain}/nodes/$host/$rid$path";
58 # Relaying produces a constant network stream!
60 # Make this a public node
61 #externalAddresses = [
62 # "${seed}:${toString radicle.node.listenPort}"
63 # #"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.onion:${toString radicle.node.listenPort}"
70 routingMaxSize = 1000;
71 routingMaxAge = 1 * 7 * 24 * 60 * 60; # 1 week
72 gossipMaxAge = 1 * 7 * 24 * 60 * 60; # 1 week
94 address = "127.0.0.1:9050";
99 description = "Radicle node hosting repositories for sourcephile.fr";
103 # Pinned repositories must be `rad clone`-d before.
105 repositories.haskell-miso-nix-demo
106 repositories.literate-phylomemy
108 repositories.symantic-base
114 systemd.services.radicle-node = {
115 environment.RUST_LOG = "debug";
117 CPUAccounting = true;
120 MemoryAccounting = true;
123 CPUSchedulingPolicy = "idle";
124 IOSchedulingClass = "idle";
125 # 0: high priority, 7: low priority
126 IOSchedulingPriority = 3;
130 services.sanoid.datasets."rpool/var/lib/${srv}" = {
131 use_template = [ "snap" ];
137 environment.systemPackages = [
141 networking.nftables.ruleset = ''
144 tcp dport ${toString radicle.node.listenPort} counter accept comment "radicle-node"
146 chain input-neb-sourcephile {
147 tcp dport ${toString radicle.node.listenPort} counter accept comment "radicle-node"
150 skuid ${users.radicle.name} meta l4proto tcp counter accept comment "radicle-node"
155 services.nginx.virtualHosts."${srv}-explorer.${domain}" = {
156 serverAliases = [ "${srv}.${domain}" ];
158 useACMEHost = domain;
161 error_log /var/log/nginx/${domain}/${srv}-explorer/error.log warn;
165 try_files $uri $uri/ /index.html;
167 index = "index.html";
168 root = pkgs.radicle-explorer.overrideAttrs (previousAttrs: {
170 (previousAttrs.postPatch or "")
172 cp ${pkgs.writeText "local.json" ''
175 "fallbackPublicExplorer": "https://app.radicle.xyz/nodes/$host/$rid$path",
176 "defaultHttpdPort": 443,
177 "defaultLocalHttpdPort": 8080,
178 "defaultHttpdHostname": "localhost",
179 "defaultHttpdScheme": "https",
180 "defaultNodePort": 8776,
184 "hostname": "${seed}",
191 "supportWebsite": "https://radicle.zulipchat.com",
192 "reactions": ["👍", "👎", "😄", "🙁", "👀"],
193 "fallbackPreferredSeed": {
194 "hostname": "${seed}",
199 ''} config/local.json
204 systemd.services.nginx.serviceConfig.LogsDirectory = lib.mkForce [
205 "nginx/${domain}/${srv}-${hostName}"
206 "nginx/${domain}/${srv}-explorer"