sysy-data/flake.nix

46 lines
1.3 KiB
Nix

{
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
"."
];
in {
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
llvmPackages_17.bintools
llvmPackages_17.libllvm
llvmPackages_17.llvm
llvmPackages_17.stdenv
rocmPackages.llvm.polly
clang_17
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 ];
};
});
}