Something went wrong. Try again.
A streaming bot for Streamplace bot.timtinkers.online
bot streamplace atproto
Something went wrong. Try again.
streamplace-bot default.nix
1.8 kB · 71 lines
Nix
at flake
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172{ lib, stdenvNoCC, nodejs_24, pnpm_11, pnpmConfigHook, fetchPnpmDeps, makeWrapper,}:let nodejs = nodejs_24; pnpm = pnpm_11;
packageJson = lib.importJSON ./package.json;instdenvNoCC.mkDerivation (finalAttrs: { pname = "streamplace-bot"; inherit (packageJson) version;
src = lib.fileset.toSource { root = ./.; fileset = lib.fileset.unions [ ./package.json ./pnpm-lock.yaml ./src ]; };
# Shared with frontend.nix: both derivations read the same pnpm-lock.yaml pnpmDeps = fetchPnpmDeps { inherit (finalAttrs) pname version src; inherit pnpm; fetcherVersion = 4; hash = "sha256-PB77S4CYjNJlRP84LhNhHGO5BSdIhRPF1aULMahAN/8="; };
nativeBuildInputs = [ pnpm nodejs pnpmConfigHook makeWrapper ];
# pnpmConfigHook already populates ./node_modules during configurePhase; # there's no build step since bot.ts is executed directly. dontBuild = true;
installPhase = '' runHook preInstall
# This node_modules also contains devDependencies (vite, svelte, etc.) # since they're not split from the frontend's in package.json. Harmless # but adds closure size; `pnpm prune --prod` here before copying would # trim it if that starts to matter. mkdir -p $out/lib/streamplace-bot cp -r src package.json node_modules $out/lib/streamplace-bot/
makeWrapper ${lib.getExe nodejs} $out/bin/streamplace-bot \ --add-flags "--experimental-strip-types" \ --add-flags "$out/lib/streamplace-bot/src/bot.ts" \ --chdir "$out/lib/streamplace-bot"
runHook postInstall '';
meta = { description = "streamplace-bot: a streaming bot for Streamplace"; mainProgram = "streamplace-bot"; license = lib.licenses.mit; };})