|
2 | 2 | description = "CourseMate"; |
3 | 3 | inputs = { |
4 | 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"; |
| 5 | + |
| 6 | + nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; |
7 | 7 |
|
8 | 8 | flake-utils.url = "github:numtide/flake-utils"; |
9 | 9 | rust-overlay = { |
10 | 10 | url = "github:oxalica/rust-overlay"; |
11 | 11 | inputs.nixpkgs.follows = "nixpkgs"; |
12 | 12 | }; |
| 13 | + |
| 14 | + prisma-utils = { |
| 15 | + url = "github:VanCoding/nix-prisma-utils"; |
| 16 | + # HACK: they have named nixpkgs pkgs. I'm submitting a fix PR soon, rename this to `inputs.nixpkgs.follows` when that gets merged. |
| 17 | + inputs.pkgs.follows = "nixpkgs"; |
| 18 | + }; |
13 | 19 | }; |
14 | 20 |
|
15 | 21 | outputs = { |
16 | 22 | nixpkgs, |
17 | 23 | flake-utils, |
18 | 24 | rust-overlay, |
19 | | - /* |
20 | | - unstable, |
21 | | - */ |
| 25 | + prisma-utils, |
| 26 | + nixpkgs-unstable, |
22 | 27 | ... |
23 | 28 | }: |
24 | 29 | flake-utils.lib.eachDefaultSystem (system: let |
25 | 30 | overlays = [(import rust-overlay)]; |
26 | 31 | pkgs = import nixpkgs { |
27 | 32 | inherit system overlays; |
28 | 33 | }; |
29 | | - # unstable-pkgs = unstable.legacyPackages.${system}; |
| 34 | + unstable = nixpkgs-unstable.legacyPackages.${system}; |
| 35 | + |
30 | 36 | rust-bin = pkgs.rust-bin.fromRustupToolchainFile ./scraper/rust-toolchain.toml; |
| 37 | + prisma = pkgs.callPackage ./server/prisma.nix {inherit prisma-utils;}; |
31 | 38 |
|
32 | 39 | common = { |
33 | | - packages = with pkgs; [ |
34 | | - nix # HACK: to fix the side effect of the hack below, installing two instances of nix |
35 | | - gnumake |
36 | | - bun |
37 | | - nodejs-slim |
38 | | - biome |
39 | | - lefthook |
40 | | - dotenv-cli |
41 | | - prisma |
42 | | - stdenv.cc.cc.lib |
43 | | - ]; |
44 | | - |
45 | | - env = with pkgs; { |
46 | | - # requird by prisma |
47 | | - PRISMA_QUERY_ENGINE_BINARY = "${prisma-engines}/bin/query-engine"; |
48 | | - PRISMA_QUERY_ENGINE_LIBRARY = "${prisma-engines}/lib/libquery_engine.node"; |
49 | | - PRISMA_INTROSPECTION_ENGINE_BINARY = "${prisma-engines}/bin/introspection-engine"; |
50 | | - PRISMA_FMT_BINARY = "${prisma-engines}/bin/prisma-fmt"; |
| 40 | + packages = |
| 41 | + (with pkgs; [ |
| 42 | + nix # HACK: to fix the side effect of the hack below, installing two instances of nix |
| 43 | + gnumake |
| 44 | + nodejs |
| 45 | + biome |
| 46 | + lefthook |
| 47 | + dotenv-cli |
| 48 | + ]) |
| 49 | + ++ (with unstable; [ |
| 50 | + bun |
| 51 | + ]); |
51 | 52 |
|
52 | | - # HACK: sharp can't find libstdc++.so.6 on bun without this |
53 | | - # - hack because: setting this may break other packages |
54 | | - # - info: it can find libstdc++.so.6 on Node.js |
55 | | - # - info: NobbZ says it's because "We can not set an rpath for a scripting language" |
56 | | - LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib"; |
57 | | - }; |
| 53 | + env = |
| 54 | + prisma.env |
| 55 | + // { |
| 56 | + # HACK: sharp can't find libstdc++.so.6 on bun without this |
| 57 | + # - hack because: setting this may break other packages |
| 58 | + # - info: it can find libstdc++.so.6 on Node.js |
| 59 | + # - info: NobbZ says it's because "We can not set an rpath for a scripting language" |
| 60 | + LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib"; |
| 61 | + }; |
58 | 62 | }; |
59 | 63 | in { |
60 | 64 | packages.scraper = pkgs.callPackage ./scraper {toolchain = rust-bin;}; |
|
0 commit comments