Skip to content

Commit e62c132

Browse files
committed
update
1 parent a6dcb03 commit e62c132

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

docker.nix

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,22 @@ let
3232
name = "writable-python";
3333
buildCommand = ''
3434
mkdir -p $out/bin
35-
mkdir -p $out/lib/python3.12/site-packages
35+
mkdir -p $out/lib/python3.12
3636
3737
# Copy Python executable from Nix store
3838
cp ${pythonWithPackages}/bin/python3.12 $out/bin/python3.12
3939
cp ${pythonWithPackages}/bin/python3 $out/bin/python3
4040
cp ${pythonWithPackages}/bin/python $out/bin/python
4141
42-
# Create symlinks for Python libraries
43-
ln -sf ${pythonWithPackages}/lib/python3.12/* $out/lib/python3.12/
42+
# Create symlinks for Python libraries, excluding site-packages
43+
for item in ${pythonWithPackages}/lib/python3.12/*; do
44+
if [ "$(basename "$item")" != "site-packages" ]; then
45+
ln -sf "$item" $out/lib/python3.12/
46+
fi
47+
done
4448
45-
# Make the site-packages directory writable
49+
# Create a writable site-packages directory
50+
mkdir -p $out/lib/python3.12/site-packages
4651
chmod -R 755 $out/lib/python3.12/site-packages
4752
'';
4853
};

0 commit comments

Comments
 (0)