-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
163 lines (158 loc) · 3.99 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
{
description = "gbp-rs";
inputs = {
# wgsl_analyzer.url = "github:wgsl-analyzer/wgsl-analyzer";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};
outputs = {
self,
nixpkgs,
rust-overlay,
flake-utils,
...
} @ inputs:
flake-utils.lib.eachDefaultSystem (system: let
overlays = [(import rust-overlay)];
pkgs = import inputs.nixpkgs {inherit system overlays;};
rust-extensions = [
"rust-src"
"rust-analyzer"
"llvm-tools-preview" # used with `cargo-pgo`
];
rust-additional-targets = ["wasm32-unknown-unknown"];
python-deps = with pkgs.python3Packages; [
numpy
scipy
rich
tabulate
matplotlib
toolz
seaborn
result
pretty-errors
seaborn
catppuccin
jupyter
notebook
pip
numpy
polars
pandas
];
# wgsl-analyzer-pkgs = import inputs.wgsl_analyzer {inherit system;};
bevy-deps = with pkgs; [
udev
alsa-lib
vulkan-loader
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
libxkbcommon
wayland
egl-wayland
freetype
fontconfig
# wgsl-analyzer-pkgs.wgsl_analyzer
# wgsl_analyzer.packages.${system}
# wgsl_analyzer.outputs.packages.${system}.default
];
cargo-subcommands = with pkgs; [
cargo-bloat
cargo-expand
cargo-outdated
cargo-show-asm
cargo-make
cargo-modules
cargo-nextest
cargo-rr
cargo-udeps
cargo-watch
cargo-wizard
cargo-pgo
cargo-flamegraph
cargo-license
cargo-release
# cargo-tree
# # cargo-profiler
# # cargo-feature
];
rust-deps = with pkgs;
[
# rustup
taplo # TOML formatter and LSP
bacon
mold # A Modern Linker
clang # For linking
gdb # debugger
# lldb # debugger
# rr # time-traveling debugger
ra-multiplex
trunk # rust wasm bundler
wasm-bindgen-cli
# binaryen # wasm-opt
sass
tailwindcss
graphviz
dot2tex
blas
# openblas
openssl
# lapack
gcc
gfortran
zlib
]
++ cargo-subcommands;
dev-deps = with pkgs; [
nodejs
just
typos # spell checker
act # run github actions local in a docker container
dot-language-server
gh
texliveFull
];
in
with pkgs; {
formatter.${system} = pkgs.alejandra;
devShells.default = pkgs.mkShell rec {
nativeBuildInputs = [pkgs.pkg-config];
buildInputs =
[
# (rust-bin.stable.latest.default.override
# {
# extensions = rust-extensions;
# targets = rust-targets;
# })
# (rust-bin.beta.latest.default.override {
# extensions = ["rust-src" "rust-analyzer"];
# })
(
rust-bin.selectLatestNightlyWith (toolchain:
toolchain.default.override {
extensions =
rust-extensions
++ [
"rustc-codegen-cranelift-preview"
];
targets = ["wasm32-unknown-unknown"];
})
)
]
++ bevy-deps
++ rust-deps
++ dev-deps
++ python-deps;
LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;
};
});
}