add direnv config and shell.nix

This commit is contained in:
Dillon Beliveau 2024-05-09 20:40:08 -07:00
parent 1e461dc014
commit 6e40a93ea1
2 changed files with 43 additions and 0 deletions

9
.envrc Normal file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# the shebang is ignored, but nice for editors
if type -P lorri &>/dev/null; then
eval "$(lorri direnv)"
else
echo 'while direnv evaluated .envrc, could not find the command "lorri" [https://github.com/nix-community/lorri]'
use nix
fi

34
shell.nix Normal file
View file

@ -0,0 +1,34 @@
{ pkgs ? import <nixpkgs> {} }:
let llvmPackage = pkgs.llvmPackages_17;
stdenv = llvmPackage.libcxxStdenv;
libcxx = llvmPackage.libraries.libcxx;
libcxxabi = llvmPackage.libraries.libcxxabi;
buildInputs = [
pkgs.hello
pkgs.cmake
llvmPackage.libcxxClang
pkgs.SDL2
pkgs.capstone
pkgs.ninja
pkgs.shaderc
pkgs.pkg-config
pkgs.dbus
pkgs.bzip2
pkgs.gdb
pkgs.vulkan-loader
stdenv
libcxx
libcxxabi
];
in
pkgs.mkShell {
buildInputs = buildInputs;
shellHook = ''
export CPATH=$CPATH:${libcxx.dev}/include/c++/v1
export CPLUS_INCLUDE_PATH=$CPATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${libcxx}/lib:${libcxxabi}/lib
'';
CPATH = pkgs.lib.makeSearchPathOutput "dev" "include" (buildInputs);
}