Minimal flake template showing how to package a Python application from PyPI
with python3Packages.buildPythonApplication. The checked-in example builds
pip-hello-world version 0.1.
git clone https://github.com/RevolunixOS/pkg-python3Packages.template.git
cd pkg-python3Packages.template
nix build
nix run- Update
pnameandversioninpackage.nix. - Choose
fetchPypior the commentedfetchFromGitHubsource. - Replace the source hash. A first build with a fake hash will print the expected value.
- Add build and runtime dependencies to
nativeBuildInputs,buildInputs, orpropagatedBuildInputsas appropriate. - Enable and configure tests instead of retaining
doCheck = false. - Correct the description, homepage, license metadata, and main program.
- Run
nix build,nix run, andnix fmt.
flake.nix x86_64-linux package output and formatter
package.nix Python package derivation
default.nix non-flake callPackage entry point
This is a learning template, not a generic generator. Python projects using Poetry, Hatch, compiled extensions, custom test fixtures, or non-PyPI sources will require additional Nix expressions.
See LICENSE.