mirror of
https://seed.radicle.dev/rad:z254T5p17bdFPmzfDojsdjo4HjpoZ.git
synced 2026-11-11 14:10:38 +08:00
56 lines
1.2 KiB
Nix
56 lines
1.2 KiB
Nix
{
|
|
pkgs,
|
|
config,
|
|
inputs,
|
|
...
|
|
}: {
|
|
systemd = {
|
|
services.radicle-bootstrap = {
|
|
serviceConfig.Type = "oneshot";
|
|
script = ''
|
|
nu ${./zone.nu} \
|
|
--db "/var/lib/radicle/node/node.db" \
|
|
--query ${./addresses.sql} \
|
|
--zone "/etc/knot/dns-sd.zone"
|
|
|
|
knotc -b zone-reload "bootstrap.radicle.network"
|
|
'';
|
|
after = ["systemd-resolved.service"];
|
|
wants = ["knot.service"];
|
|
requires = [
|
|
"knot.service"
|
|
"systemd-resolved.service"
|
|
];
|
|
path = with pkgs; [
|
|
knot-dns
|
|
nushell
|
|
config.systemd.package
|
|
];
|
|
};
|
|
timers.radicle-bootstrap = {
|
|
timerConfig = {
|
|
OnCalendar = "*:0/5";
|
|
RandomizedDelaySec = "1min";
|
|
Unit = "radicle-bootstrap.service";
|
|
};
|
|
wantedBy = ["timers.target"];
|
|
};
|
|
};
|
|
services.nginx.virtualHosts."bootstrap.radicle.network" = {
|
|
enableACME = true;
|
|
forceSSL = true;
|
|
quic = true;
|
|
serverName = "bootstrap.radicle.network";
|
|
root = "/var/www/bootstrap.radicle.network";
|
|
|
|
extraConfig = ''
|
|
add_header Alt-Svc 'h3=":443"' always;
|
|
'';
|
|
|
|
locations."/".extraConfig = ''
|
|
add_header 'Access-Control-Allow-Origin' '*';
|
|
autoindex on;
|
|
'';
|
|
};
|
|
}
|