/nix/store/dlwqlnbaj5vfm9aw20r1yxk8y56lmgif-repo/header.tmpl
nichts/modules/services/radicle.mod.nix

57 lines
1.4 KiB
Nix
Raw Permalink Normal View History

2025-09-03 19:58:27 +02:00
{
config,
lib,
...
}:
let
inherit (lib.lists) singleton;
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
2025-09-04 11:56:17 +02:00
inherit (builtins) toString;
2025-09-04 12:00:00 +02:00
port = 3867;
httpd_port = 3868;
domain = "seed.faukah.com";
2025-09-03 19:58:27 +02:00
cfg = config.modules.system.services.radicle;
in
{
options.modules.system.services.radicle.enable = mkEnableOption "radicle";
2025-09-04 12:00:00 +02:00
config.services = mkIf cfg.enable {
nginx = {
2025-09-03 19:58:27 +02:00
enable = true;
2025-09-04 12:00:00 +02:00
virtualHosts.${domain} = {
2025-09-03 19:58:27 +02:00
addSSL = true;
enableACME = true;
2025-09-04 12:00:00 +02:00
locations."/" = {
proxyPass = "http://localhost:${toString httpd_port}";
};
2025-09-03 19:58:27 +02:00
};
};
2025-09-04 12:00:00 +02:00
radicle = {
enable = true;
checkConfig = true;
privateKeyFile = "/etc/ssh/ssh_host_ed25519_key";
publicKey = "/etc/ssh/ssh_host_ed25519_key.pub";
httpd = {
enable = true;
listenPort = httpd_port;
};
settings = {
2025-09-06 16:13:27 +02:00
preferredSeeds = [
"z6MkrLMMsiPWUcNPHcRajuMi9mDfYckSoJyPwwnknocNYPm7@iris.radicle.xyz:8776"
"z6Mkmqogy2qEM2ummccUthFEaaHvyYmYBYh3dbe9W4ebScxo@rosa.radicle.xyz:8776"
];
2025-09-04 12:00:00 +02:00
node = {
alias = domain;
listen = singleton "[::]:${toString port}";
externalAddresses = singleton "${domain}:${toString port}";
seedingPolicy = {
default = "block";
scope = "all";
};
2025-09-03 19:58:27 +02:00
};
};
};
};
}