50 lines
1.1 KiB
Nix
50 lines
1.1 KiB
Nix
{ pkgs ? import <nixpkgs> {} }:
|
|
|
|
let
|
|
# We may need some packages from nixpkgs-unstable
|
|
#unstable = import <nixpkgs-unstable> {};
|
|
|
|
rust-toolchain = pkgs.symlinkJoin {
|
|
name = "rust-toolchain";
|
|
paths = [pkgs.rustc pkgs.cargo pkgs.rustfmt pkgs.rustPlatform.rustcSrc];
|
|
};
|
|
in
|
|
|
|
pkgs.mkShell {
|
|
|
|
buildInputs = [
|
|
rust-toolchain
|
|
|
|
pkgs.pkg-config
|
|
|
|
pkgs.sqlx-cli
|
|
|
|
#pkgs.libclang # ??
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
pkgs.openssl
|
|
];
|
|
|
|
LIBCLANG_PATH="${pkgs.llvmPackages_latest.libclang.lib}/lib";
|
|
|
|
# Cargo culted:
|
|
# Add to rustc search path
|
|
# RUSTFLAGS = (builtins.map (a: ''-L ${a}/lib'') [
|
|
# ]);
|
|
# Add to bindgen search path
|
|
BINDGEN_EXTRA_CLANG_ARGS =
|
|
# Includes with normal include path
|
|
(builtins.map (a: ''-I"${a}/include"'') [
|
|
pkgs.glibc.dev
|
|
])
|
|
# Includes with special directory paths
|
|
++ [
|
|
''-I"${pkgs.llvmPackages_latest.libclang.lib}/lib/clang/${pkgs.llvmPackages_latest.libclang.version}/include"''
|
|
#''-I"${pkgs.glib.dev}/include/glib-2.0"''
|
|
#''-I${pkgs.glib.out}/lib/glib-2.0/include/''
|
|
];
|
|
|
|
|
|
}
|