Unverified Commit fee695a9 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

sillytavern: change to global installation (#432510)

parents 42efe1cc 41613e73
Loading
Loading
Loading
Loading
+7 −13
Original line number Diff line number Diff line
{
  makeBinaryWrapper,
  buildNpmPackage,
  nodejs,
  fetchFromGitHub,
  lib,
}:
@@ -17,19 +15,12 @@ buildNpmPackage (finalAttrs: {
  };
  npmDepsHash = "sha256-hayhsEZN857V6bsWPXupLeqxcOr1sgKs0uWN2pSQD+k=";

  nativeBuildInputs = [ makeBinaryWrapper ];

  dontNpmBuild = true;
  installPhase = ''
    runHook preInstall

    mkdir -p $out/{bin,opt}
    cp -r . $out/opt/sillytavern
    makeWrapper ${lib.getExe nodejs} $out/bin/sillytavern \
      --add-flags $out/opt/sillytavern/server.js \
      --set-default NODE_ENV production

    runHook postInstall
  # These dirs are not installed automatically.
  # And if they were not in place, the app would try to create them at runtime, which is of course impossible to achieve.
  postInstall = ''
    mkdir $out/lib/node_modules/sillytavern/{backups,public/scripts/extensions/third-party}
  '';

  meta = {
@@ -37,6 +28,9 @@ buildNpmPackage (finalAttrs: {
    longDescription = ''
      SillyTavern is a user interface you can install on your computer (and Android phones) that allows you to interact with
      text generation AIs and chat/roleplay with characters you or the community create.

      This package makes a global installation, instead of a standalone installation according to the official tutorial.
      See [the official documentation](https://docs.sillytavern.app/installation/#global--standalone-mode) for the context.
    '';
    downloadPage = "https://github.com/SillyTavern/SillyTavern/releases";
    homepage = "https://docs.sillytavern.app/";