diff options
| author | Alejandro Soto <alejandro@34project.org> | 2026-01-30 00:42:28 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2026-01-31 11:25:56 -0600 |
| commit | 3e688f113ce6f63e8575447a3827ef7fc24299f8 (patch) | |
| tree | 0f6a1befd5eddfd9287be1fbbc318a90af87bed7 /trivionomicon/pkgs/socialpredict/default.nix | |
| parent | c426c0fddbcbe3e7113ef2f8b69215e5471c75f0 (diff) | |
trivionomicon: socialpredict: initial commit
Diffstat (limited to '')
| -rw-r--r-- | trivionomicon/pkgs/socialpredict/default.nix | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/trivionomicon/pkgs/socialpredict/default.nix b/trivionomicon/pkgs/socialpredict/default.nix new file mode 100644 index 0000000..813bc87 --- /dev/null +++ b/trivionomicon/pkgs/socialpredict/default.nix @@ -0,0 +1,62 @@ +{ + buildGoModule, + buildNpmPackage, + fetchFromGitHub, + lib, +}: let + version = "2.1.0"; + + src = fetchFromGitHub { + owner = "openpredictionmarkets"; + repo = "socialpredict"; + tag = "v${version}"; + hash = "sha256-aV6Z7vsqV8zxyB+v7hSyOm/jzGqR8YnhG+xLKSC9Qoo="; + }; + + meta = { + description = "Easy to Deploy Prediction Market Platform "; + homepage = "https://github.com/openpredictionmarkets/socialpredict"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; []; # [ _3442 ]; + }; +in { + backend = buildGoModule { + pname = "socialpredict-backend"; + inherit src version; + + patches = [ + ./0001-Support-POSTGRES_URL-for-overriding-the-PG-DSN.patch + ]; + + sourceRoot = "source/backend"; + vendorHash = "sha256-ah2d+gHe7HULEsqMSUwGOL4D00aY0QtZvcD3pTQp/Q0="; + + meta = meta // {mainProgram = "socialpredict";}; + }; + + frontend = buildNpmPackage { + pname = "socialpredict-frontend"; + inherit src meta version; + + sourceRoot = "source/frontend"; + npmDepsHash = "sha256-zn1yPtvi8DaKESMGAtqnh/66xET+QaCa1TUlpbatI70="; + + buildPhase = '' + runHook preBuild + + node --max_old_space_size=1024000 ./node_modules/vite/bin/vite.js build + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out + cp -r build/* $out + rm $out/env-config.js.template + + runHook postInstall + ''; + }; +} |
