Files
radicle-infra/os/host/seed/bootstrap/default.nix
T
2025-10-17 12:33:42 +02:00

49 lines
1.1 KiB
Nix

{
pkgs,
config,
inputs,
...
}: {
systemd = {
services.radicle-bootstrap = {
serviceConfig.Type = "oneshot";
script = ''
cat "${./addresses.sql}" | sqlite3 "/var/lib/radicle/node/node.db" | \
jq --slurp add | \
jq \
--raw-output \
--arg serviceName "_radicle-node.tcp" \
--from-file "${./zone.jq}" \
> "/etc/knot/dns-sd.zone"
knotc -b zone-reload "bootstrap.radicle.xyz"
'';
wants = ["knot.service"];
requires = ["knot.service"];
path = with pkgs; [
jq
sqlite
knot-dns
];
};
timers.radicle-bootstrap = {
timerConfig = {
OnCalendar = "*:0/5";
RandomizedDelaySec = "1min";
Unit = "radicle-bootstrap.service";
};
wantedBy = ["timers.target"];
};
};
services.nginx.virtualHosts."bootstrap.radicle.xyz" = {
enableACME = true;
forceSSL = true;
serverName = "bootstrap.radicle.xyz";
root = "/var/www/bootstrap.radicle.xyz";
locations."/".extraConfig = ''
add_header 'Access-Control-Allow-Origin' '*';
autoindex on;
'';
};
}