diff options
| author | Alejandro Soto <alejandro@34project.org> | 2025-06-05 19:46:06 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2025-06-05 19:46:06 -0600 |
| commit | 1479ef448c05761ee70ea5d3e2e30fba80fd18d7 (patch) | |
| tree | 97feea503016b133d67fe445bf488e3bf9bfc482 /pkgs/spliit/default.nix | |
| parent | e9ad601a8978ec4231fd23c90fdcf595e8bf897d (diff) | |
pkgs: add spliit
Diffstat (limited to 'pkgs/spliit/default.nix')
| -rw-r--r-- | pkgs/spliit/default.nix | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/spliit/default.nix b/pkgs/spliit/default.nix new file mode 100644 index 0000000..5ac56b1 --- /dev/null +++ b/pkgs/spliit/default.nix @@ -0,0 +1,64 @@ +{ + buildNpmPackage, + fetchFromGitHub, + nodePackages, + lib, + writeShellScriptBin, +}: +buildNpmPackage { + pname = "spliit2"; + version = "master-20250420"; + + src = fetchFromGitHub { + repo = "spliit"; + owner = "spliit-app"; + + rev = "a11efc79c13298c0d282e47496d132538752405f"; + hash = "sha256-v4gaPzLzBbbqw/LDYxe1fiyficcrqcGOop23YPiTrdc="; + }; + + npmDepsHash = "sha256-sd0/7ruNUFxUKTeTwx/v8Vc/G3llkXP6RSDE78h3qVU="; + npmRebuildFlags = ["--ignore-scripts"]; + + doCheck = false; + + postPatch = '' + cp -v .env.example .env + ''; + + # nixpkgs/pkgs/applications/office/documenso/default.nix (git)-[master] 05:36:05 + preBuild = '' + # somehow for linux, npm is not finding the prisma package with the + # packages installed with the lockfile. + # This generates a prisma version incompatibility warning and is a kludge + # until the upstream package-lock is modified. + ${lib.getExe nodePackages.prisma} generate + ''; + + postInstall = '' + install -Dvm755 -t $out/bin ${lib.getExe (writeShellScriptBin "spliit2" '' + set -euxo pipefail + + cd @out@/lib/node_modules/spliit2 + + export PATH="$PWD/node_modules/.bin:$PATH" + export NEXT_TELEMETRY_DISABLED=1 + + prisma migrate deploy + exec next start + '')} + + #kk? + #${lib.getExe nodePackages.prisma} migrate deploy + + substituteInPlace $out/bin/spliit2 \ + --replace @out@ $out + ''; + + meta = { + description = "Free and Open Source Alternative to Splitwise. Share expenses with your friends and family."; + homepage = "https://spliit.app"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; []; + }; +} |
