···11{
22- makeBinaryWrapper,
32 buildNpmPackage,
44- nodejs,
53 fetchFromGitHub,
64 lib,
75}:
···1715 };
1816 npmDepsHash = "sha256-hayhsEZN857V6bsWPXupLeqxcOr1sgKs0uWN2pSQD+k=";
19172020- nativeBuildInputs = [ makeBinaryWrapper ];
2121-2218 dontNpmBuild = true;
2323- installPhase = ''
2424- runHook preInstall
25192626- mkdir -p $out/{bin,opt}
2727- cp -r . $out/opt/sillytavern
2828- makeWrapper ${lib.getExe nodejs} $out/bin/sillytavern \
2929- --add-flags $out/opt/sillytavern/server.js \
3030- --set-default NODE_ENV production
3131-3232- runHook postInstall
2020+ # These dirs are not installed automatically.
2121+ # And if they were not in place, the app would try to create them at runtime, which is of course impossible to achieve.
2222+ postInstall = ''
2323+ mkdir $out/lib/node_modules/sillytavern/{backups,public/scripts/extensions/third-party}
3324 '';
34253526 meta = {
···3728 longDescription = ''
3829 SillyTavern is a user interface you can install on your computer (and Android phones) that allows you to interact with
3930 text generation AIs and chat/roleplay with characters you or the community create.
3131+3232+ This package makes a global installation, instead of a standalone installation according to the official tutorial.
3333+ See [the official documentation](https://docs.sillytavern.app/installation/#global--standalone-mode) for the context.
4034 '';
4135 downloadPage = "https://github.com/SillyTavern/SillyTavern/releases";
4236 homepage = "https://docs.sillytavern.app/";