Skip to content

Commit 89b51cd

Browse files
committed
Fix flake.nix to use correct uv2nix API
Use editablePythonSet with mkVirtualEnv and add proper UV environment variables.
1 parent dcd7539 commit 89b51cd

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

flake.nix

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,27 @@
4343
};
4444

4545
# Create Python set with overlay applied
46-
python = pkgs.python314.override {
46+
pythonSet = (pkgs.python314.override {
47+
self = pythonSet;
4748
packageOverrides = lib.composeManyExtensions [
4849
pyproject-build-systems.overlays.default
4950
overlay
5051
];
52+
});
53+
54+
# Create editable overlay for development
55+
editableOverlay = workspace.mkEditablePyprojectOverlay {
56+
root = "$REPO_ROOT";
57+
};
58+
59+
# Apply editable overlay
60+
editablePythonSet = pythonSet.override {
61+
self = editablePythonSet;
62+
packageOverrides = editableOverlay;
5163
};
5264

53-
# Create virtual environment with editablePackages
54-
venv = python.pkgs.mkVirtualEnv "staffeli-nt-env" workspace.deps.default;
65+
# Create virtual environment with all dependencies
66+
venv = editablePythonSet.mkVirtualEnv "staffeli-nt-dev-env" workspace.deps.all;
5567

5668
in
5769
{
@@ -61,7 +73,16 @@
6173
pkgs.uv
6274
];
6375

76+
env = {
77+
UV_NO_SYNC = "1";
78+
UV_PYTHON = editablePythonSet.python.interpreter;
79+
UV_PYTHON_DOWNLOADS = "never";
80+
};
81+
6482
shellHook = ''
83+
unset PYTHONPATH
84+
export REPO_ROOT=$(git rev-parse --show-toplevel)
85+
6586
echo "Staffeli NT development environment"
6687
echo "Python: $(python --version)"
6788
echo ""

0 commit comments

Comments
 (0)