complete radicle module and enable it on Cape

This commit is contained in:
ulic-youthlic 2025-05-13 08:00:32 +08:00
parent 9913207890
commit e9f186d8ff
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
3 changed files with 94 additions and 59 deletions

View file

@ -7,6 +7,7 @@
./users ./users
./disko-config.nix ./disko-config.nix
./miniflux.nix ./miniflux.nix
./radicle.nix
]; ];
youthlic = { youthlic = {

View file

@ -0,0 +1,9 @@
{config, ...}: {
sops.secrets."ssh-private-key/radicle/Cape" = {};
youthlic.programs.radicle = {
enable = true;
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBbQrJNWcWsFncTX4w/hkhz6zPNwHrTjA+6lnq5dmu/s radicle";
privateKeyFile = config.sops.secrets."ssh-private-key/radicle/Cape".path;
domain = "seed.youthlic.fun";
};
}

View file

@ -14,13 +14,21 @@ in {
publicKey = lib.mkOption { publicKey = lib.mkOption {
type = with lib.types; either path str; type = with lib.types; either path str;
}; };
domain = lib.mkOption {
type = lib.types.str;
}; };
}; };
config = lib.mkIf cfg.enable { };
config = lib.mkMerge [
(lib.mkIf cfg.enable {
services.radicle = { services.radicle = {
enable = true; enable = true;
node.listenAddress = "127.0.0.1";
inherit (cfg) publicKey privateKeyFile; inherit (cfg) publicKey privateKeyFile;
node.openFirewall = true;
httpd = {
enable = true;
listenPort = 8489;
};
settings = { settings = {
publicExplorer = "https://app.radicle.xyz/nodes/$host/$rid$path"; publicExplorer = "https://app.radicle.xyz/nodes/$host/$rid$path";
preferredSeeds = [ preferredSeeds = [
@ -30,20 +38,27 @@ in {
]; ];
web = { web = {
pinned = { pinned = {
repositories = []; repositories = [
"rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5"
"rad:z4D5UCArafTzTQpDZNQRuqswh3ury"
"rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5"
"rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt"
];
}; };
}; };
cli = { cli = {
hints = true; hints = true;
}; };
node = { node = {
alias = "youthlic"; alias = cfg.domain;
listen = []; listen = [];
peers = { peers = {
type = "dynamic"; type = "dynamic";
}; };
connect = []; connect = [];
extrnalAddresses = []; externalAddresses = [
"${cfg.domain}:8776"
];
network = "main"; network = "main";
log = "INFO"; log = "INFO";
relay = "auto"; relay = "auto";
@ -75,5 +90,15 @@ in {
}; };
}; };
}; };
})
(lib.mkIf (cfg.enable && config.youthlic.programs.caddy.enable) {
services.caddy.virtualHosts = {
"${cfg.domain}" = {
extraConfig = ''
reverse_proxy 127.0.0.1:8489
'';
}; };
};
})
];
} }