add radicle-explorer module, and enable it on Cape

This commit is contained in:
ulic-youthlic 2025-05-12 16:19:44 +08:00
parent 6632dde007
commit 975bf38dc2
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
8 changed files with 42 additions and 1 deletions

View file

@ -28,6 +28,7 @@
caddy = {
enable = true;
baseDomain = "youthlic.fun";
radicle-explorer.enable = true;
};
juicity.server.enable = true;
};

View file

@ -5,6 +5,9 @@
}: let
cfg = config.youthlic.programs.caddy;
in {
imports = [
./radicle-explorer.nix
];
options = {
youthlic.programs.caddy = {
enable = lib.mkEnableOption "caddy";

View file

@ -0,0 +1,27 @@
{
config,
lib,
pkgs,
...
}: let
cfg = config.youthlic.programs.caddy.radicle-explorer;
caddy-cfg = config.youthlic.programs.caddy;
in {
options = {
youthlic.programs.caddy.radicle-explorer = {
enable = lib.mkEnableOption "caddy.radicle-explorer";
};
};
config = lib.mkIf (cfg.enable && caddy-cfg.enable) {
services.caddy.virtualHosts = {
"radicle.${caddy-cfg.baseDomain}" = {
extraConfig = ''
root * ${pkgs.radicle-explorer}
encode zstd gzip
try_files {path} /index.html
file_server
'';
};
};
};
}

View file

@ -7,7 +7,7 @@
./transfer-sh.nix
./rustypaste
./mautrix-telegram.nix
./caddy.nix
./caddy
./dae
./forgejo.nix
./kanata.nix

View file

@ -8,6 +8,7 @@ in
./dae.nix
./jujutsu.nix
./spotifyx.nix
./radicle-explorer.nix
]
|> map (file: import file args)
|> (overlays: (lib.composeManyExtensions overlays) final prev)

View file

@ -0,0 +1,5 @@
{outputs, ...}: final: prev: let
inherit (prev.stdenv.hostPlatform) system;
in {
radicle-explorer = outputs.packages."${system}".radicle-explorer;
}

View file

@ -13,6 +13,7 @@ in
rime-ice = callPackage ./rime-ice.nix {};
dioxionary = callPackage ./dioxionary.nix {};
spotifyx = callPackage ./spotifyx.nix {};
radicle-explorer = callPackage ./radicle-explorer.nix {};
noto-serif-cjk = callPackage ./noto-serif-cjk.nix {};
noto-sans-cjk = callPackage ./noto-sans-cjk.nix {};

View file

@ -0,0 +1,3 @@
{pkgs, ...}:
pkgs.radicle-explorer.withConfig {
}