package OuterWildsTextAdventureWeb as caddy service

This commit is contained in:
ulic-youthlic 2025-05-31 03:42:12 +08:00
parent 5844040624
commit cae1182840
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
10 changed files with 119 additions and 16 deletions

View file

@ -30,6 +30,7 @@
enable = true;
baseDomain = "youthlic.fun";
radicle-explorer.enable = true;
outer-wilds-text-adventure.enable = true;
};
juicity.server.enable = true;
};

View file

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

View file

@ -7,6 +7,7 @@
in {
imports = [
./radicle-explorer.nix
./OuterWildsTextAdventure.nix
];
options = {
youthlic.programs.caddy = {

View file

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

View file

@ -4,6 +4,7 @@ in
[
./rime-ice.nix
./TrackersListCollection.nix
./OuterWildsTextAdventure.nix
]
|> map (file: import file args)
|> (overlays: (lib.composeManyExtensions overlays) final prev)

View file

@ -0,0 +1,30 @@
{
srcs,
buildNpmPackage,
importNpmLock,
...
}: let
inherit (srcs.OuterWildsTextAdventure) src date version;
in
buildNpmPackage {
pname = "OuterWildsTextAdventure";
version = "0-unstable.${date}-git${version}";
inherit src;
npmDeps = importNpmLock {
npmRoot = src;
};
npmBuildScript = "bundle";
installPhase = ''
runHook preInstall
mkdir -p $out
cp -rt $out/ index.html data p5.min.js bundle.js bundle.js.map
runHook postInstall
'';
npmConfigHook = importNpmLock.npmConfigHook;
}

View file

@ -1,7 +1,28 @@
{
"OuterWildsTextAdventure": {
"cargoLocks": null,
"date": "2024-12-21",
"extract": null,
"name": "OuterWildsTextAdventure",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "top-mind",
"repo": "OuterWildsTextAdventureWeb",
"rev": "2a4430a6e53fc2e9979e0f4ebb312d90b92ba119",
"sha256": "sha256-sINGUxPj3V257zbuMnT/TK2j8Bwj9Rck4uXx7Y1fTQY=",
"sparseCheckout": [],
"type": "github"
},
"version": "2a4430a6e53fc2e9979e0f4ebb312d90b92ba119"
},
"TrackersListCollection": {
"cargoLocks": null,
"date": "2025-05-26",
"date": "2025-05-31",
"extract": null,
"name": "TrackersListCollection",
"passthru": null,
@ -13,14 +34,14 @@
"name": null,
"owner": "XIU2",
"repo": "TrackersListCollection",
"rev": "1886c4360d2f02eb3ade5abda634f70729137e00",
"sha256": "sha256-wLaYJCNWH9dQL7vbq/1ueXd/rNGzJcWt7Eu+U64RX0Q=",
"rev": "313c18fc1ae756ea99ae6275e4454ccff95d9b5d",
"sha256": "sha256-yCcWx/tnz7JjHs6wniuy6owqIMjZrOS13HBz4MgtiAg=",
"sparseCheckout": [
"all.txt"
],
"type": "github"
},
"version": "1886c4360d2f02eb3ade5abda634f70729137e00"
"version": "313c18fc1ae756ea99ae6275e4454ccff95d9b5d"
},
"dioxionary": {
"cargoLocks": {
@ -115,7 +136,7 @@
},
"rime-ice": {
"cargoLocks": null,
"date": "2025-05-25",
"date": "2025-05-29",
"extract": null,
"name": "rime-ice",
"passthru": null,
@ -127,12 +148,12 @@
"name": null,
"owner": "iDvel",
"repo": "rime-ice",
"rev": "904aedb7c2097309e4f5a9be29baf6ce5cc64415",
"sha256": "sha256-a0b6k0dOwrdxCf+ZcX/fiF4K1LLGuEw5eBriRFkY2AI=",
"rev": "2e0d8d9a3ba292ecca3f6dccb5719a06764917ca",
"sha256": "sha256-v+j2Bp7+OEbiWImf0/6YbZTTHlaORvtK2foXTfjZW9s=",
"sparseCheckout": [],
"type": "github"
},
"version": "904aedb7c2097309e4f5a9be29baf6ce5cc64415"
"version": "2e0d8d9a3ba292ecca3f6dccb5719a06764917ca"
},
"spotx": {
"cargoLocks": null,

View file

@ -1,20 +1,32 @@
# This file was generated by nvfetcher, please do not modify it manually.
{ fetchgit, fetchurl, fetchFromGitHub, dockerTools }:
{
OuterWildsTextAdventure = {
pname = "OuterWildsTextAdventure";
version = "2a4430a6e53fc2e9979e0f4ebb312d90b92ba119";
src = fetchFromGitHub {
owner = "top-mind";
repo = "OuterWildsTextAdventureWeb";
rev = "2a4430a6e53fc2e9979e0f4ebb312d90b92ba119";
fetchSubmodules = false;
sha256 = "sha256-sINGUxPj3V257zbuMnT/TK2j8Bwj9Rck4uXx7Y1fTQY=";
};
date = "2024-12-21";
};
TrackersListCollection = {
pname = "TrackersListCollection";
version = "1886c4360d2f02eb3ade5abda634f70729137e00";
version = "313c18fc1ae756ea99ae6275e4454ccff95d9b5d";
src = fetchFromGitHub {
owner = "XIU2";
repo = "TrackersListCollection";
rev = "1886c4360d2f02eb3ade5abda634f70729137e00";
rev = "313c18fc1ae756ea99ae6275e4454ccff95d9b5d";
fetchSubmodules = false;
deepClone = false;
leaveDotGit = false;
sparseCheckout = [ "all.txt" ];
sha256 = "sha256-wLaYJCNWH9dQL7vbq/1ueXd/rNGzJcWt7Eu+U64RX0Q=";
sha256 = "sha256-yCcWx/tnz7JjHs6wniuy6owqIMjZrOS13HBz4MgtiAg=";
};
date = "2025-05-26";
date = "2025-05-31";
};
dioxionary = {
pname = "dioxionary";
@ -80,15 +92,15 @@
};
rime-ice = {
pname = "rime-ice";
version = "904aedb7c2097309e4f5a9be29baf6ce5cc64415";
version = "2e0d8d9a3ba292ecca3f6dccb5719a06764917ca";
src = fetchFromGitHub {
owner = "iDvel";
repo = "rime-ice";
rev = "904aedb7c2097309e4f5a9be29baf6ce5cc64415";
rev = "2e0d8d9a3ba292ecca3f6dccb5719a06764917ca";
fetchSubmodules = false;
sha256 = "sha256-a0b6k0dOwrdxCf+ZcX/fiF4K1LLGuEw5eBriRFkY2AI=";
sha256 = "sha256-v+j2Bp7+OEbiWImf0/6YbZTTHlaORvtK2foXTfjZW9s=";
};
date = "2025-05-25";
date = "2025-05-29";
};
spotx = {
pname = "spotx";

View file

@ -16,6 +16,7 @@ in
radicle-explorer = callPackage ./radicle-explorer {};
TrackersListCollection = callPackage ./TrackersListCollection.nix {};
wshowkeys-mao = callPackage ./wshowkeys-mao.nix {};
OuterWildsTextAdventure = callPackage ./OuterWildsTextAdventure.nix {};
noto-serif-cjk = callPackage ./noto-serif-cjk.nix {};
noto-sans-cjk = callPackage ./noto-sans-cjk.nix {};

View file

@ -38,3 +38,7 @@ git.sparseCheckout = ["all.txt"]
[wshowkeys-mao]
src.git = "https://github.com/DreamMaoMao/wshowkeys.git"
fetch.github = "DreamMaoMao/wshowkeys"
[OuterWildsTextAdventure]
src.git = "https://github.com/top-mind/OuterWildsTextAdventureWeb.git"
fetch.github = "top-mind/OuterWildsTextAdventureWeb"