-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
69 lines (64 loc) · 1.73 KB
/
Copy pathflake.nix
File metadata and controls
69 lines (64 loc) · 1.73 KB
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
{
description = "Dev shell that syncs automatically with rust-toolchain.toml via Fenix";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
fenix.url = "github:nix-community/fenix";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = {
self,
nixpkgs,
fenix,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {inherit system;};
rustStable = fenix.packages.${system}.fromToolchainFile {
file = ./rust-toolchain.toml;
sha256 = "sha256-SJwZ8g0zF2WrKDVmHrVG3pD2RGoQeo24MEXnNx5FyuI=";
};
rustNightly = fenix.packages.${system}.complete;
rust = fenix.packages.${system}.combine [
rustNightly.rustfmt
rustStable
];
nativeLibs = [
pkgs.libGL
pkgs.xorg.libX11
pkgs.xorg.libXi
pkgs.xorg.libXrender
pkgs.xorg.libXcursor
pkgs.libxkbcommon
pkgs.mesa
pkgs.libgbm
];
in {
devShells = {
default = pkgs.mkShell {
buildInputs =
[
rust
pkgs.cargo-deb
pkgs.cargo-cross
pkgs.just
pkgs.nodePackages.prettier
]
++ nativeLibs;
shellHook = ''
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath nativeLibs}:$LD_LIBRARY_PATH"
'';
};
cross = pkgs.mkShell {
buildInputs = [
pkgs.rustup
pkgs.cargo-deb
pkgs.cargo-cross
pkgs.just
];
};
};
formatter = pkgs.alejandra;
}
);
}