Skip to content

Commit e6512de

Browse files
committed
Create cargo config in devshell only if we're in the correct repo
1 parent 62986a2 commit e6512de

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.dgb-n64-root

Whitespace-only changes.

flake.nix

+11-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,17 @@
100100
{
101101
buildInputs = devShellTools ++ tools ++ libs;
102102
shellHook = ''
103-
mkdir -p ./src/jit/.cargo
104-
ln -s ${cargoConfigFile} ./src/jit/.cargo/config.toml
103+
FLAKE_ROOT="$(git rev-parse --show-toplevel)"
104+
(
105+
cd "$FLAKE_ROOT"
106+
if [ -f .dgb-n64-root ]; then
107+
echo "Creating cargo config.toml to use vendored dependencies"
108+
mkdir -p ./src/jit/.cargo
109+
ln -sf ${cargoConfigFile} ./src/jit/.cargo/config.toml
110+
else
111+
echo "Did not find .dgb-n64-root, not creating cargo config.toml"
112+
fi
113+
)
105114
'' + (if stdenv.isLinux then ''
106115
export LD_LIBRARY_PATH="${pkgs.vulkan-loader}/lib";
107116
'' else if stdenv.isDarwin then ''

0 commit comments

Comments
 (0)