mirror of
https://github.com/SikongJueluo/ya-vla.git
synced 2025-12-20 06:27:49 +08:00
build: make environment adapt to Nixos
This commit is contained in:
14
devenv.nix
14
devenv.nix
@@ -60,6 +60,18 @@
|
||||
KERNEL_DIR = "${pkgs.linuxHeaders}/include";
|
||||
};
|
||||
|
||||
# 创建 .venv 软链接到 .devenv/state/venv
|
||||
scripts.linkVenv.exec = ''
|
||||
if [ -L ".venv" ] || [ ! -e ".venv" ]; then
|
||||
rm -f ".venv" 2>/dev/null || true
|
||||
ln -s ".devenv/state/venv" ".venv"
|
||||
echo "Created symlink: .venv -> .devenv/state/venv"
|
||||
elif [ -e ".venv" ]; then
|
||||
echo "Warning: .venv exists and is not a symlink. Not replacing it."
|
||||
echo "If you want to replace it with a symlink, please remove it manually first."
|
||||
fi
|
||||
'';
|
||||
|
||||
# https://devenv.sh/basics/
|
||||
enterShell = ''
|
||||
export NIX_LD_LIBRARY_PATH="$NIX_LD_LIBRARY_PATH:${lib.makeLibraryPath [ pkgs.linuxHeaders ]}";
|
||||
@@ -69,5 +81,7 @@
|
||||
echo "LD_LIBRARY_PATH set to $LD_LIBRARY_PATH"
|
||||
echo "CPATH set to $CPATH"
|
||||
echo "KERNEL_DIR set to $KERNEL_DIR"
|
||||
|
||||
linkVenv
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user