forked from fabian/nix
		
	spliit: added functional package
This commit is contained in:
		
							parent
							
								
									517c240c19
								
							
						
					
					
						commit
						a78a4f764e
					
				
					 1 changed files with 27 additions and 14 deletions
				
			
		|  | @ -4,7 +4,14 @@ | ||||||
|   nodePackages, |   nodePackages, | ||||||
|   lib, |   lib, | ||||||
|   writeShellScriptBin, |   writeShellScriptBin, | ||||||
|  |   pkgs | ||||||
| }: | }: | ||||||
|  | let  | ||||||
|  |   schemaEngine = "${pkgs.prisma-engines}/bin/schema-engine"; | ||||||
|  |   queryEngineBin = "${pkgs.prisma-engines}/bin/query-engine"; | ||||||
|  |   queryEngineLib = "${pkgs.prisma-engines}/lib/libquery_engine.node"; | ||||||
|  |   buildFlags = [ "--ignore-scripts" ]; | ||||||
|  | in | ||||||
| buildNpmPackage { | buildNpmPackage { | ||||||
|   pname = "spliit2"; |   pname = "spliit2"; | ||||||
|   version = "master-20250420"; |   version = "master-20250420"; | ||||||
|  | @ -18,24 +25,26 @@ buildNpmPackage { | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   npmDepsHash = "sha256-sd0/7ruNUFxUKTeTwx/v8Vc/G3llkXP6RSDE78h3qVU="; |   npmDepsHash = "sha256-sd0/7ruNUFxUKTeTwx/v8Vc/G3llkXP6RSDE78h3qVU="; | ||||||
|   npmRebuildFlags = ["--ignore-scripts"]; |  | ||||||
| 
 | 
 | ||||||
|   doCheck = false; |   nativeBuildInputs = [ pkgs.openssl ]; | ||||||
| 
 | 
 | ||||||
|   postPatch = '' |   npmRebuildFlags = buildFlags; | ||||||
|     cp -v .env.example .env | 
 | ||||||
|   ''; |   PRISMA_SCHEMA_ENGINE_BINARY = schemaEngine; | ||||||
|  |   PRISMA_QUERY_ENGINE_BINARY  = queryEngineBin; | ||||||
|  |   PRISMA_QUERY_ENGINE_LIBRARY = queryEngineLib; | ||||||
| 
 | 
 | ||||||
|   # nixpkgs/pkgs/applications/office/documenso/default.nix          (git)-[master]  05:36:05 |  | ||||||
|   preBuild = '' |   preBuild = '' | ||||||
|     # somehow for linux, npm is not finding the prisma package with the |     cp -v scripts/build.env .env | ||||||
|     # packages installed with the lockfile. | 
 | ||||||
|     # This generates a prisma version incompatibility warning and is a kludge |     npx prisma generate | ||||||
|     # until the upstream package-lock is modified. |  | ||||||
|     ${lib.getExe nodePackages.prisma} generate |  | ||||||
|   ''; |   ''; | ||||||
| 
 | 
 | ||||||
|  |   npmBuildFlags = buildFlags; | ||||||
|  | 
 | ||||||
|   postInstall = '' |   postInstall = '' | ||||||
|  |     cp -r .next public package.json next.config.mjs $out/lib/node_modules/spliit2 | ||||||
|  | 
 | ||||||
|     install -Dvm755 -t $out/bin ${lib.getExe (writeShellScriptBin "spliit2" '' |     install -Dvm755 -t $out/bin ${lib.getExe (writeShellScriptBin "spliit2" '' | ||||||
|       set -euxo pipefail |       set -euxo pipefail | ||||||
| 
 | 
 | ||||||
|  | @ -44,15 +53,19 @@ buildNpmPackage { | ||||||
|       export PATH="$PWD/node_modules/.bin:$PATH" |       export PATH="$PWD/node_modules/.bin:$PATH" | ||||||
|       export NEXT_TELEMETRY_DISABLED=1 |       export NEXT_TELEMETRY_DISABLED=1 | ||||||
| 
 | 
 | ||||||
|  |       export PRISMA_SCHEMA_ENGINE_BINARY="${schemaEngine}" | ||||||
|  |       export PRISMA_QUERY_ENGINE_BINARY="${queryEngineBin}" | ||||||
|  |       export PRISMA_QUERY_ENGINE_LIBRARY="${queryEngineLib}" | ||||||
|  | 
 | ||||||
|       prisma migrate deploy |       prisma migrate deploy | ||||||
|       exec next start |       exec next start | ||||||
|     '')} |     '')} | ||||||
| 
 | 
 | ||||||
|     #kk? |  | ||||||
|     #${lib.getExe nodePackages.prisma} migrate deploy |  | ||||||
| 
 |  | ||||||
|     substituteInPlace $out/bin/spliit2 \ |     substituteInPlace $out/bin/spliit2 \ | ||||||
|       --replace @out@ $out |       --replace @out@ $out | ||||||
|  | 
 | ||||||
|  |     wrapProgram $out/bin/spliit2 \ | ||||||
|  |       --prefix PATH : ${lib.makeBinPath [ pkgs.openssl ]} | ||||||
|   ''; |   ''; | ||||||
| 
 | 
 | ||||||
|   meta = { |   meta = { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue