Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
66 lines (60 loc) · 1.79 KB
/
Copy pathflake.nix
File metadata and controls
66 lines (60 loc) · 1.79 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
{
description = "ZHMTools development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, fenix }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
llvm = pkgs.llvmPackages;
fenixPkgs = fenix.packages.${system};
rustToolchain = fenixPkgs.combine [
fenixPkgs.complete.rustc
fenixPkgs.complete.cargo
fenixPkgs.complete.rust-src
fenixPkgs.complete.clippy
fenixPkgs.complete.rustfmt
fenixPkgs.targets.x86_64-pc-windows-msvc.latest.rust-std
];
commonNativeBuildInputs = [
pkgs.cmake
pkgs.ninja
pkgs.pkg-config
pkgs.git
rustToolchain
pkgs.xwin
llvm.clang-unwrapped
pkgs.lld
llvm.llvm
pkgs.glibc.static
pkgs.curl
pkgs.zip
pkgs.unzip
pkgs.gnutar
pkgs.zstd
pkgs.gdb
];
mkShellHook = stdenv: ''
export CC="${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
export CXX="${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++"
export XWIN_SPLAT_DIR="$PWD/.xwin/splat"
'';
in
{
devShells = {
default = (pkgs.mkShell.override { stdenv = llvm.libcxxStdenv; }) {
nativeBuildInputs = commonNativeBuildInputs ++ [
llvm.clang-tools # clangd, clang-format, clang-tidy
llvm.lldb
];
shellHook = mkShellHook llvm.libcxxStdenv;
};
};
});
}