diff options
| author | Fabian Montero <fabian@posixlycorrect.com> | 2026-02-03 15:12:59 -0600 |
|---|---|---|
| committer | Fabian Montero <fabian@posixlycorrect.com> | 2026-02-03 15:12:59 -0600 |
| commit | 4a822c48da5a3aa4550fd0fad2697fd023c1810a (patch) | |
| tree | 3ad3d1fc31c545daf0d1c221c5cefba83c6cea04 /pkgs/socialpredict/default.nix | |
| parent | e44c6337d4557c9377b562e3687d24ef5e236974 (diff) | |
| parent | 0f6a8aa22d9b554c211a9d77bbf4fefdcabc20d1 (diff) | |
Merge commit '974154ce2da0b60bdff5ae3c57e0490db58d9f0e'
Diffstat (limited to 'pkgs/socialpredict/default.nix')
| -rw-r--r-- | pkgs/socialpredict/default.nix | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/pkgs/socialpredict/default.nix b/pkgs/socialpredict/default.nix new file mode 100644 index 0000000..22dc6a9 --- /dev/null +++ b/pkgs/socialpredict/default.nix @@ -0,0 +1,66 @@ +{ + 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="; + + patches = [ + ./0002-Fix-API_URL-api-v0-.-API_URL-v0.patch + ]; + + 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 + ''; + }; +} |
