eculocate

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

shell.nix (1787B)


      1 { pkgs ? import <nixpkgs> {} }:
      2   let
      3     overrides = (builtins.fromTOML (builtins.readFile ./rust-toolchain.toml));
      4     libPath = with pkgs; lib.makeLibraryPath [
      5       # load external libraries that you need in your rust project here
      6     ];
      7     python = (pkgs.python3.withPackages (python-pkgs: [
      8       python-pkgs.pynacl
      9       python-pkgs.zeroconf
     10       python-pkgs.bleak
     11     ]));
     12   in
     13   pkgs.mkShell rec {
     14     buildInputs = with pkgs; [
     15       clang
     16       # Replace llvmPackages with llvmPackages_X, where X is the latest LLVM version (at the time of writing, 16)
     17       llvmPackages.bintools
     18       rustup
     19 
     20       entr
     21       python
     22       openssl
     23     ];
     24     RUSTC_VERSION = overrides.toolchain.channel;
     25     # https://github.com/rust-lang/rust-bindgen#environment-variables
     26     LIBCLANG_PATH = pkgs.lib.makeLibraryPath [ pkgs.llvmPackages_latest.libclang.lib ];
     27     shellHook = ''
     28       export PATH=$PATH:''${CARGO_HOME:-~/.cargo}/bin
     29       export PATH=$PATH:''${RUSTUP_HOME:-~/.rustup}/toolchains/$RUSTC_VERSION-x86_64-unknown-linux-gnu/bin/
     30       '';
     31     # Add precompiled library to rustc search path
     32     RUSTFLAGS = (builtins.map (a: ''-L ${a}/lib'') [
     33       # add libraries here (e.g. pkgs.libvmi)
     34     ]);
     35     LD_LIBRARY_PATH = libPath;
     36     # Add glibc, clang, glib, and other headers to bindgen search path
     37     BINDGEN_EXTRA_CLANG_ARGS =
     38     # Includes normal include path
     39     (builtins.map (a: ''-I"${a}/include"'') [
     40       # add dev libraries here (e.g. pkgs.libvmi.dev)
     41       pkgs.glibc.dev
     42     ])
     43     # Includes with special directory paths
     44     ++ [
     45       ''-I"${pkgs.llvmPackages_latest.libclang.lib}/lib/clang/${pkgs.llvmPackages_latest.libclang.version}/include"''
     46       ''-I"${pkgs.glib.dev}/include/glib-2.0"''
     47       ''-I${pkgs.glib.out}/lib/glib-2.0/include/''
     48     ];
     49   }