|
1 | 1 | { |
2 | 2 | description = "CourseMate"; |
3 | 3 | inputs = { |
4 | | - nixpkgs.url = "github:NixOS/nixpkgs/master"; |
| 4 | + nixpkgs.url = "github:NixOS/nixpkgs/release-24.11"; |
| 5 | + # prisma v6 is only out on unstable uncomment this on updating prisma to v6. can be removed when 25.05 channel is released |
| 6 | + # unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; |
| 7 | + |
5 | 8 | flake-utils.url = "github:numtide/flake-utils"; |
6 | | - prisma-utils.url = "github:VanCoding/nix-prisma-utils"; |
7 | 9 | fenix = { |
8 | 10 | url = "github:nix-community/fenix/monthly"; |
9 | 11 | inputs.nixpkgs.follows = "nixpkgs"; |
10 | 12 | }; |
11 | 13 | }; |
12 | 14 |
|
13 | | - outputs = { nixpkgs, flake-utils, prisma-utils, fenix, ... }: |
| 15 | + outputs = { nixpkgs, flake-utils, fenix, /* unstable, */ ... }: |
14 | 16 | flake-utils.lib.eachDefaultSystem (system: |
15 | 17 | let |
16 | | - pkgs = import nixpkgs { inherit system; }; |
17 | | - prisma = import ./nix/prisma.nix { inherit prisma-utils pkgs; }; |
18 | | - rust-pkgs = import ./nix/rust-toolchain.nix { inherit fenix system; }; |
19 | | - in |
20 | | - { |
21 | | - devShell = pkgs.mkShell { |
22 | | - src = ./.; |
23 | | - nativeBuildInputs = with pkgs; [ bashInteractive ]; |
| 18 | + pkgs = nixpkgs.legacyPackages.${system}; |
| 19 | + # unstable-pkgs = unstable.legacyPackages.${system}; |
| 20 | + rust-toolchain = import ./nix/rust-toolchain.nix { inherit fenix system; }; |
| 21 | + |
| 22 | + common = { |
24 | 23 | buildInputs = with pkgs; [ |
25 | 24 | gnumake |
26 | 25 | bun |
27 | 26 | biome |
28 | | - pkg-config |
29 | | - openssl |
30 | 27 | lefthook |
31 | | - pkgs.prisma |
32 | 28 | dotenv-cli |
33 | | - ] ++ [ |
34 | | - rust-pkgs |
| 29 | + prisma |
| 30 | + prisma-engines |
| 31 | + ]; |
| 32 | + |
| 33 | + shellHook = with pkgs; '' |
| 34 | + # requird by prisma |
| 35 | + export PRISMA_QUERY_ENGINE_BINARY="${prisma-engines}/bin/query-engine"; |
| 36 | + export PRISMA_QUERY_ENGINE_LIBRARY="${prisma-engines}/lib/libquery_engine.node"; |
| 37 | + export PRISMA_INTROSPECTION_ENGINE_BINARY="${prisma-engines}/bin/introspection-engine"; |
| 38 | + export PRISMA_FMT_BINARY="${prisma-engines}/bin/prisma-fmt"; |
| 39 | + ''; |
| 40 | + }; |
| 41 | + in |
| 42 | + { |
| 43 | + devShells.default = pkgs.mkShell common; |
| 44 | + devShells.scraper = pkgs.mkShell { |
| 45 | + buildInputs = common.buildInputs ++ [ |
| 46 | + pkgs.pkg-config |
| 47 | + pkgs.openssl |
| 48 | + rust-toolchain |
35 | 49 | ]; |
36 | | - shellHook = '' |
37 | | - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${pkgs.stdenv.cc.cc.lib}/lib |
38 | | - '' + prisma.shellHook; |
| 50 | + shellHook = common.shellHook; |
39 | 51 | }; |
40 | 52 | }); |
41 | 53 | } |
| 54 | + |
0 commit comments