Skip to content

Commit ff63cf2

Browse files
committed
Simplify flake.nix using pyproject-nix.build.packages
Use the simpler pattern from simple-uv2nix template instead of manual Python override.
1 parent 89b51cd commit ff63cf2

File tree

1 file changed

+12
-27
lines changed

1 file changed

+12
-27
lines changed

flake.nix

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,22 @@
4242
sourcePreference = "wheel";
4343
};
4444

45-
# Create Python set with overlay applied
46-
pythonSet = (pkgs.python314.override {
47-
self = pythonSet;
48-
packageOverrides = lib.composeManyExtensions [
49-
pyproject-build-systems.overlays.default
50-
overlay
51-
];
52-
});
53-
54-
# Create editable overlay for development
55-
editableOverlay = workspace.mkEditablePyprojectOverlay {
56-
root = "$REPO_ROOT";
45+
# Create base Python set
46+
baseSet = pyproject-nix.build.packages {
47+
inherit pkgs;
48+
python = pkgs.python314;
5749
};
5850

59-
# Apply editable overlay
60-
editablePythonSet = pythonSet.override {
61-
self = editablePythonSet;
62-
packageOverrides = editableOverlay;
63-
};
51+
# Apply overlays to create final Python set
52+
pythonSet = baseSet.overrideScope (
53+
lib.composeManyExtensions [
54+
pyproject-build-systems.overlays.default
55+
overlay
56+
]
57+
);
6458

6559
# Create virtual environment with all dependencies
66-
venv = editablePythonSet.mkVirtualEnv "staffeli-nt-dev-env" workspace.deps.all;
60+
venv = pythonSet.mkVirtualEnv "staffeli-nt-dev-env" workspace.deps.all;
6761

6862
in
6963
{
@@ -73,16 +67,7 @@
7367
pkgs.uv
7468
];
7569

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

0 commit comments

Comments
 (0)