Skip to content

Commit 0310611

Browse files
authored
Add flake.nix for Prisma Client on NixOS (#2219)
1 parent 4d8743b commit 0310611

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

flake.nix

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Run `nix develop` to get a shell with the prisma CLI
2+
# reference: https://github.com/VanCoding/nix-prisma-utils
3+
4+
{
5+
inputs = {
6+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
7+
prisma-utils.url = "github:VanCoding/nix-prisma-utils";
8+
};
9+
10+
outputs =
11+
{ nixpkgs, prisma-utils, ... }:
12+
let
13+
system = "x86_64-linux";
14+
pkgs = nixpkgs.legacyPackages.${system};
15+
prisma =
16+
(prisma-utils.lib.prisma-factory {
17+
inherit pkgs;
18+
# just copy these hashes for now, and then change them when nix complains about the mismatch
19+
prisma-fmt-hash = "sha256-atD5GZfmeU86mF1V6flAshxg4fFR2ews7EwaJWZZzbc=";
20+
query-engine-hash = "sha256-8FTZaKmQCf9lrDQvkF5yWPeZ7TSVfFjTbjdbWWEHgq4=";
21+
libquery-engine-hash = "sha256-USIdaum87ekGY6F6DaL/tKH0BAZvHBDK7zjmCLo//kM=";
22+
schema-engine-hash = "sha256-k5MkxXViEqojbkkcW/4iBFNdfhb9PlMEF1M2dyhfOok=";
23+
}).fromNpmLock
24+
./package-lock.json; # <--- path to our package-lock.json file that contains the version of prisma-engines
25+
in
26+
{
27+
devShells.${system}.default = pkgs.mkShell {
28+
env = prisma.env;
29+
# or, you can use `shellHook` instead of `env` to load the same environment variables.
30+
# shellHook = prisma.shellHook;
31+
};
32+
};
33+
}
34+

0 commit comments

Comments
 (0)