-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
86 lines (77 loc) · 2.5 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
# Fix duplicate instances of these inputs by pointing them to my inputs
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
# Read from `rust-toolchain.toml` instead of adding `rust-bin.nightly.latest.default` to devShell `buildInputs`
rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
# Libraries that are mostly needed for tauri to work
libraries = with pkgs; [
webkitgtk
gtk3
cairo
gdk-pixbuf
glib
dbus
openssl_3
librsvg
];
packages = with pkgs; [
curl
wget
pkg-config
# webkitgtk
# gtk3
# glib
# dbus
# openssl_3
# librsvg
libsoup
sqlite
nodejs_20
nodePackages.pnpm
# prisma-engines
# nodePackages.prisma
];
# Inputs needed at compile-time
nativeBuildInputs = with pkgs; [ /* rustToolchain */ ];
# Inputs needed at runtime
buildInputs = with pkgs; [ ] ++ packages ++ libraries;
in
{
# packages.default = derivation {
# inherit system;
# name = "simple";
# builder = with pkgs; "${bash}/bin/bash";
# args = [ "-c" "echo foo > $out" ];
# src = ./.;
# };
devShells.default = pkgs.mkShell {
inherit buildInputs nativeBuildInputs;
# buildInputs = packages;
shellHook = ''
PATH="$PWD/node_modules/.bin:$PATH"
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath libraries}:$LD_LIBRARY_PATH
'';
PRISMA_SCHEMA_ENGINE_BINARY = "${pkgs.prisma-engines}/bin/schema-engine";
PRISMA_QUERY_ENGINE_BINARY = "${pkgs.prisma-engines}/bin/query-engine";
PRISMA_QUERY_ENGINE_LIBRARY = "${pkgs.prisma-engines}/lib/libquery_engine.node";
PRISMA_FMT_BINARY = "${pkgs.prisma-engines}/bin/prisma-fmt";
};
});
}