Skip to content

Commit 5cd9499

Browse files
authored
flake: overall improvement (#568)
1 parent a0d78b9 commit 5cd9499

File tree

3 files changed

+43
-111
lines changed

3 files changed

+43
-111
lines changed

flake.lock

Lines changed: 11 additions & 80 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,54 @@
11
{
22
description = "CourseMate";
33
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+
58
flake-utils.url = "github:numtide/flake-utils";
6-
prisma-utils.url = "github:VanCoding/nix-prisma-utils";
79
fenix = {
810
url = "github:nix-community/fenix/monthly";
911
inputs.nixpkgs.follows = "nixpkgs";
1012
};
1113
};
1214

13-
outputs = { nixpkgs, flake-utils, prisma-utils, fenix, ... }:
15+
outputs = { nixpkgs, flake-utils, fenix, /* unstable, */ ... }:
1416
flake-utils.lib.eachDefaultSystem (system:
1517
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 = {
2423
buildInputs = with pkgs; [
2524
gnumake
2625
bun
2726
biome
28-
pkg-config
29-
openssl
3027
lefthook
31-
pkgs.prisma
3228
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
3549
];
36-
shellHook = ''
37-
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${pkgs.stdenv.cc.cc.lib}/lib
38-
'' + prisma.shellHook;
50+
shellHook = common.shellHook;
3951
};
4052
});
4153
}
54+

nix/prisma.nix

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)