sysy-data/flake.nix

46 lines
1.3 KiB
Nix
Raw Normal View History

2024-07-26 22:30:35 +08:00
{
description = "Rust development environment with Clang and LLVM support";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
libPath = pkgs.lib.makeLibraryPath [
# load external libraries that you need in your rust project here
2024-07-26 23:22:00 +08:00
"."
2024-07-26 22:30:35 +08:00
];
in {
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
2024-08-04 11:46:02 +08:00
llvmPackages_17.bintools
llvmPackages_17.libllvm
llvmPackages_17.llvm
llvmPackages_17.stdenv
2024-07-26 22:30:35 +08:00
rocmPackages.llvm.polly
2024-08-04 11:46:02 +08:00
clang_17
2024-07-26 22:30:35 +08:00
rustup
glib
gcc
libxml2
(with pkgsCross.riscv64; [ glib.stdenv.cc buildPackages.gdb ])
qemu
];
LD_LIBRARY_PATH = libPath;
shellHook = ''
export PATH=$PATH:''${CARGO_HOME:-~/.cargo}/bin
export PATH=$PATH:''${RUSTUP_HOME:-~/.rustup}/toolchains/$RUSTC_VERSION-x86_64-unknown-linux-gnu/bin/
'';
# LIBCLANG_PATH = pkgs.lib.makeLibraryPath [ pkgs.llvmPackages_latest.libclang.lib ];
};
});
}