Add the plebleader daily sync and package the archive CLI

`sync` refreshes the token chain first, then fetches new BeatLeader and
ScoreSaber scores (with a day of overlap), their replays, score stats,
leaderboards and map zips, and re-snapshots every played hash on Sundays.
The flake's plebleader-archive package runs the CLI with Node's type
stripping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 07:55:58 -08:00
co-authored by Claude Opus 5.5
parent 51c1e6d3d1
commit d182fd808c
4 changed files with 119 additions and 17 deletions
+23
View File
@@ -44,12 +44,35 @@
mainProgram = "plebsaber-stream";
};
};
# The plebleader archive CLI (scripts/archive, docs/plan.md): plain
# TypeScript with only Node built-ins, run through Node's type stripping.
mkArchiveCli = pkgs:
pkgs.stdenvNoCC.mkDerivation {
pname = "plebleader-archive";
version = "0.1.0";
src = ./scripts/archive;
nativeBuildInputs = [ pkgs.makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/lib/plebleader-archive
cp *.ts $out/lib/plebleader-archive/
makeWrapper ${pkgs.nodejs_22}/bin/node $out/bin/plebleader-archive \
--add-flags "--experimental-strip-types --disable-warning=ExperimentalWarning" \
--add-flags "$out/lib/plebleader-archive/cli.ts"
runHook postInstall
'';
meta = {
description = "Archive exporter and daily sync for the personal BeatLeader mirror";
mainProgram = "plebleader-archive";
};
};
in rec {
packages = forAllSystems (system: let
pkgs = import nixpkgs { inherit system; };
pkg = mkPackage pkgs;
in {
plebsaber-stream = pkg;
plebleader-archive = mkArchiveCli pkgs;
default = pkg;
});