Repository navigation
Level-3 uv2nix flake template: Nix is the gate, uv owns the expression - #1
Merged
Merged
Conversation
Turn the README stub into a cloneable Nix flake template: uv owns pyproject.toml/uv.lock, uv2nix builds the same Python set for nix develop and nix run, and mkApplication ships the product. Co-authored-by: NebuHedron <NebuHedron@users.noreply.github.com>
Keep linux + aarch64-darwin. CI flake show evaluates the host system only. Co-authored-by: NebuHedron <NebuHedron@users.noreply.github.com>
NebuHedron
marked this pull request as ready for review
August 31, 2026 16:26
VirtualMachinist
added a commit
that referenced
this pull request
Sep 13, 2026
…e-5a3f Level-3 uv2nix flake template: Nix is the gate, uv owns the expression
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Turn this repo from a README stub into a public, reusable Nix flake template for any Python shop.
Model:
mkVirtualEnv/withPackagesbuilds a world;mkApplication/wrapProgramlocks the door; nix-ld is the FHS lie (unsafe, Level 2). This template is Level 3.A non-NixOS developer still
uv syncs fromuv.lock. A Nix user or CInix develops andnix run .#s the same closure. Two proofs:uv.lock(packages) andflake.lock(builders). A lockfile is not a closure.What's in the PR
flake.nix— uv2nix + pyproject.nix + pyproject-build-systems; same Python set fordevShells.defaultandpackages.default; peace treaty (UV_NO_SYNC,UV_PYTHON,UV_PYTHON_DOWNLOADS=never, unsetPYTHONPATH)templates.defaultsonix flake new -t github:Hedronite/python-gateworkssrc/python_gateconsole script +rich;nix run .#is network-free (versions +square(12))docs/theses.md.gitignore(.venv,result,__pycache__, direnv)nix build/nix run) anduv sync --lockedSystems:
x86_64-linux,aarch64-linux,aarch64-darwin. nixos-unstable 26.11 dropped Intel Macs.MIT copyright Hedronite 2026 is unchanged.
After merge, mark the GitHub repo as a template repository so Use this template works alongside the flake template.
Verified locally
nix flake showlistspackages.x86_64-linux.default,devShells.x86_64-linux.default,templates.defaultnix build+nix run .#prints the closed-world table (no network)nix develop --command python -c "import python_gate, rich"— peace treaty holdsuv sync --lockednix flake check(includingtemplates.default.isValidTemplate)nix flake new -t path:.copies the templateAgent grading
nix flake showlists default package, devShell, and templateuv sync --lockednix runuses the same Python set asnix develop