-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
79 lines (69 loc) · 2.47 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
{
description = "Bearbroider Stack";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-23.05";
inputs.turbo.url = "github:alexghr/turborepo.nix/v1.8.3";
inputs.turbo.inputs.nixpkgs.follows = "nixpkgs";
inputs.utils.url = "github:numtide/flake-utils";
inputs.fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, turbo, utils, fenix }:
utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
rustToolchain = fenix.packages.${system}.fromToolchainFile {
file = ./rust-toolchain.toml;
sha256 = "sha256-Q9UgzzvxLi4x9aWUJTn+/5EXekC98ODRU1TwhUs9RnY=";
};
rustPlatform = pkgs.makeRustPlatform.override { stdenv = pkgs.clangStdenv; } {
inherit (rustToolchain) cargo rustc;
};
platformBuildInputs = {
x86_64-linux = [
# Monorepo build system
turbo.packages.${system}.default
pkgs.nodejs
pkgs.nodePackages.pnpm
pkgs.nodePackages.typescript
pkgs.nodePackages.typescript-language-server
rustPlatform.bindgenHook
pkgs.openssl
pkgs.binaryen
pkgs.pkg-config
pkgs.udev
pkgs.alsa-lib
pkgs.vulkan-loader
pkgs.xorg.libX11
pkgs.xorg.libXcursor
pkgs.xorg.libXi
pkgs.xorg.libXrandr
# To use the x11 feature
];
x86_64-darwin = [
# Rust deps
pkgs.clang
pkgs.iconv
pkgs.darwin.libobjc
pkgs.darwin.apple_sdk.frameworks.AppKit
rustPlatform.bindgenHook
# Monorepo build system
turbo.packages.${system}.default
pkgs.nodejs
pkgs.nodePackages.pnpm
pkgs.nodePackages.typescript
pkgs.nodePackages.typescript-language-server
];
};
in {
devShells.default = with pkgs; mkShell rec {
nativeBuildInputs = [ bashInteractive ];
buildInputs = platformBuildInputs.${system};
shellHook = ''
export TURBO_BINARY_PATH="${turbo.packages.${system}.default}/bin/turbo"
'';
LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;
};
}
);
}