Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NixOS support #2305

Closed
arjunv27 opened this issue Apr 26, 2020 · 14 comments
Closed

NixOS support #2305

arjunv27 opened this issue Apr 26, 2020 · 14 comments
Labels
kind/feature A request for a new feature. topic: deployment-platform

Comments

@arjunv27
Copy link

arjunv27 commented Apr 26, 2020

Problem

Unable to use Prisma on NixOS, receiving "Error: Get config" due to binaryTargets, documentation provides no options for NixOS

Solution

Develop with Prisma successfully on NixOS

@Jolg42

This comment has been minimized.

@janpio janpio changed the title Nixos support NixOS support Apr 27, 2020
@pantharshit00

This comment has been minimized.

@husseinraoouf
Copy link

@pantharshit00
I have tried and still the same error
the fetch binaries script downloads the debian-openssl-1.1.x binaries I think because it couldn't detect NixOS

also, I don't think NixOS is based on alpine ( but I am not sure )

@Jolg42

This comment has been minimized.

@Jolg42

This comment has been minimized.

@pantharshit00
Copy link
Contributor

I did some research on nix and it is whole config based. You will need to add nodejs to your nix config in order to install it.

See: https://nixos.org/nixos/manual/index.html#sec-package-management and maybe go through the manual otherwise, I will mail you a vmdk with a installation

@Jolg42
Copy link
Contributor

Jolg42 commented May 25, 2020

Looks like this worked in the NixOS VirtualBox nix-shell -p nodejs I can now reproduce the error 🎊

@Jolg42
Copy link
Contributor

Jolg42 commented May 26, 2020

So it will now output a warning message saying that pre-compiled binaries are not available for nixos, so it's easier to understand what's happening here.

We do not have plan to provide pre-compiled binaries for NixOS for now.

See these 2 issues for more info about how to compile the binaries:
https://github.com/prisma/prisma/issues/2146
https://github.com/prisma/prisma/issues/1840

@husseinraoouf
Copy link

husseinraoouf commented May 26, 2020

@Jolg42
that is better than the old error message for sure

I have managed to get the CLI working by compiling the rust binaries from source and copying them to the package folder in node_modules

I have also packaged the cli as nix package for anyone else wanting to use Prisma in NixOS
at https://gitlab.com/husseinraoouf/nur-repository you can use it by directly importing my git repo or wait till it is in NUR Repos 😃 ( update it is in NUR Repos now )

I think this issue could be closed now and maybe update the documentation about the support of NixOS

@Jolg42
Copy link
Contributor

Jolg42 commented May 27, 2020

Awesome! I will keep this open for now as it's not an official support and no decision was taken yet on this.

Thanks for posting your nix package it will probably be useful for other people 👍

@husseinraoouf
Copy link

@Jolg42
I can't do prisma generate after updating to Beta.6 it shows this error

Error: Unknown binaryTargets nixos-openssl-1.1.x

I think because the cli now can recognize NixOS, the binary target became nixos-openssl-1.1.x instead of the default fallback debian-openssl-1.1.x

I think it could be solved by adding nixos-openssl-1.1.x to the possible values of binaryTargets

@Jolg42
Copy link
Contributor

Jolg42 commented May 28, 2020

@husseinraoouf Indeed!
I just fixed that in the latest alpha, you can try it like this npx @prisma/cli@2.0.0-alpha.1258

Let me know if this solves it or not.

@husseinraoouf
Copy link

Thank you it works now 🎉

@Jolg42
Copy link
Contributor

Jolg42 commented Jul 15, 2020

Closing this was unblocked.

Tracking providing pre-built binaries in #3026

@Jolg42 Jolg42 closed this as completed Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A request for a new feature. topic: deployment-platform
Projects
None yet
Development

No branches or pull requests

4 participants