Created
August 17, 2021 11:10
-
-
Save schickling/065dede7b5b57d5b6d1ceb9853c178b5 to your computer and use it in GitHub Desktop.
Prisma 2.29.1 nixos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| with import <nixpkgs> {}; | |
| # prisma-bin.nix | |
| let | |
| prismaDrv = {stdenv,fetchurl,openssl,zlib,autoPatchelfHook,lib} : | |
| let | |
| hostname = "binaries.prisma.sh"; | |
| channel = "all_commits"; | |
| target = "debian-openssl-1.1.x"; | |
| baseUrl = "https://${hostname}/${channel}"; | |
| commit = "1be4cd60b89afa04b192acb1ef47758a39810f3a"; | |
| hashes = { | |
| introspection-engine = "37d4c7d940294283bdd863f3115a2a3aa2a00cd4ef3d82b284b5111a3c9562d8"; | |
| migration-engine = "61b11a193a779e0af2fde6bcc87c2feaa929683cfec9d799bc48b493b22a2985"; | |
| prisma-fmt = "c031eda8ea3e05ea6505b6ac7b0815c383d09d6afb874edd356543c3467a5594"; | |
| query-engine = "867709d94095e1346cd80e919b39fd140391c82bb6c1dd635806f0daaede1002"; | |
| }; | |
| files = lib.mapAttrs (name: sha256: fetchurl { | |
| url = "${baseUrl}/${commit}/${target}/${name}.gz"; | |
| inherit sha256; | |
| }) hashes; | |
| unzipCommands = lib.mapAttrsToList (name: file: "gunzip -c ${file} > $out/bin/${name}") files; | |
| in | |
| stdenv.mkDerivation rec { | |
| pname = "prisma-bin"; | |
| version = "2.29.1"; | |
| nativeBuildInputs = [ | |
| autoPatchelfHook | |
| zlib | |
| openssl | |
| ]; | |
| phases = ["buildPhase" "postFixupHooks" ]; | |
| buildPhase = '' | |
| mkdir -p $out/bin | |
| ${lib.concatStringsSep "\n" unzipCommands} | |
| chmod +x $out/bin/* | |
| ''; | |
| }; | |
| prismaPkg = callPackage prismaDrv {}; | |
| in mkShell { | |
| buildInputs = [ | |
| nodejs-14_x | |
| yarn | |
| prismaPkg | |
| ]; | |
| shellHook = '' | |
| export PRISMA_MIGRATION_ENGINE_BINARY="${prismaPkg}/bin/migration-engine" | |
| export PRISMA_QUERY_ENGINE_BINARY="${prismaPkg}/bin/query-engine" | |
| export PRISMA_INTROSPECTION_ENGINE_BINARY="${prismaPkg}/bin/introspection-engine" | |
| export PRISMA_FMT_BINARY="${prismaPkg}/bin/prisma-fmt" | |
| ''; | |
| } |
Do you have the right variables in place, did you read this example?
Hey mate! Thank you very much for the reply!
Yes, I did read the example and I did have the variables in place (at least I think).
Anyway, I've dropped it for docker as I needed to get things done.
I'll get back to it later and see if I can get it working.
Thanks again, mate!
Have a great day! =D
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello mate! All fine?
Does it work?
I'm having issues making the prisma/cli to discover the correct engines.
Maybe could you give me a hand, please?
Now I have
prisma-enginesandnodePackeages.prismainstalled,prisma generateseems to work well, but when I try to query anything from code I get this:I really don't want to have to leave nixos just because of prisma T_T
Thanks in advance!