Skip to content

Template of a Python Development Environment with Optional CUDA Support. Powered by uv.

Notifications You must be signed in to change notification settings

clementpoiret/nix-python-devenv

Repository files navigation

Nix Python Devenv

A Python development environment template using devenv with working C bindings, managed by uv package manager.

A version of this repo with CUDA is available on the cuda branch.

Features

  • CUDA toolkit and CUDNN support (see the cuda branch)
  • Python 3.x environment
  • Fast package management with uv
  • Automatic environment activation with direnv
  • Example script using numpy

Installation

  1. Install Nix:

    sh <(curl -L https://nixos.org/nix/install) --daemon
  2. Install devenv

    nix-env -iA devenv -f https://github.com/NixOS/nixpkgs/tarball/nixpkgs-unstable
  3. Install direnv (optional but recommended)

  4. Clone and setup:

    git clone --single-branch --branch cuda [email protected]:clementpoiret/nix-python-devenv.git
    
    # Allow direnv to manage the environment
    direnv allow

Usage

The environment automatically:

  • Activates the Python virtual environment
  • Sets up LD_LIBRARY_PATH
  • Provides the hello command to test C Bindings

Run the sample script:

hello

This will display the output of numpy functions.

About

Template of a Python Development Environment with Optional CUDA Support. Powered by uv.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published