Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
51 lines (49 loc) · 1.49 KB
/
Copy pathflake.nix
File metadata and controls
51 lines (49 loc) · 1.49 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/24.05";
utils.url = "github:numtide/flake-utils";
fenix = {
url = "github:nix-community/fenix/monthly";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, utils, nixpkgs, fenix, }: utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
rust = fenix.packages.${system};
in {
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
(rust.latest.withComponents [
"cargo"
"clippy"
"rust-src"
"rustc"
"rustfmt"
"rust-analyzer"
])
protobuf
llvmPackages_16.bintools clang
pkg-config libxkbcommon openssl libiconv
wayland wayland-protocols libffi
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Foundation
darwin.apple_sdk.frameworks.Cocoa
darwin.apple_sdk.frameworks.Metal
darwin.apple_sdk.frameworks.MetalKit
darwin.apple_sdk.frameworks.QuartzCore
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.AppKit
];
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
RUST_BACKTRACE = 1;
# RUSTFLAGS = "-C target-cpu=native";
PROTOC = "${pkgs.protobuf}/bin/protoc";
PROTOC_INCLUDE = "${pkgs.protobuf}/include";
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
pkgs.libxkbcommon
pkgs.wayland
pkgs.libffi
];
};
});
}