Skip to content

Commit 6ab4943

Browse files
committed
chore: update docker.nix
1 parent 71724bd commit 6ab4943

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

docker.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ let
2424
matplotlib
2525
scikit-learn
2626
seaborn
27+
networkx # Graphs for optimization (e.g. VRP, routing)
2728
# Optimization solvers
2829
gurobipy
2930
pulp # PuLP - Python Linear Programming (no protobuf dependency)
@@ -795,6 +796,18 @@ finally:
795796
mkdir -p /.local/lib/python3.12/site-packages
796797
mkdir -p "$HOME" || true
797798
799+
# For "uv pip install", ensure --target points to writable dir (Nix store is read-only)
800+
UV_TARGET="/.local/lib/python3.12/site-packages"
801+
if [ "$1" = "pip" ] && [ "$2" = "install" ]; then
802+
has_target=
803+
for arg in "$@"; do
804+
if [ "$arg" = "--target" ] || [ "$arg" = "-t" ]; then has_target=1; break; fi
805+
done
806+
if [ -z "$has_target" ]; then
807+
set -- "pip" "install" "--target" "$UV_TARGET" ''${@:3}
808+
fi
809+
fi
810+
798811
# Start uv
799812
exec ${pkgs.uv}/bin/uv "$@"
800813
'';
@@ -1387,6 +1400,8 @@ FONTSCONF
13871400
# Font configuration for matplotlib
13881401
"FONTCONFIG_PATH=/etc/fonts"
13891402
"MPLCONFIGDIR=/home/python-user/.matplotlib"
1403+
# PTY/TUI: terminal type for interactive shells (vim, less, top, etc.)
1404+
"TERM=xterm-256color"
13901405
# Disable dangerous modules
13911406
"PYTHON_DISABLE_MODULES=os,subprocess,sys,importlib,exec,eval,compile,__import__,open,file,input,raw_input,urllib,requests,socket,ftplib,smtplib,poplib,imaplib,nntplib,telnetlib"
13921407
# Restrict network access

0 commit comments

Comments
 (0)