Skip to content

Latest commit

 

History

History
51 lines (31 loc) · 1.71 KB

README.md

File metadata and controls

51 lines (31 loc) · 1.71 KB

pyenv Nix Overlay and Flake (👹IMPURE🐍)

Setups up all the things for you to do python dev, particularly for ML, and just use pip directly on nixos.

WARNING

As we're playing outside the repeatability of Nix and /nix paths of nix-managed libraries, you may need to pyenv uninstall and pyenv install specific versions of local shared libraries if this were linked against. This can be an issue if you haev upgraded libraries outside of this flake.

When would I need this?

  • For when you need to get stuff done and don't want to be faffing with your default.nix or flake.nix on a NixOS system
  • This flake allows you to directly pip intall a whole bunch of python deps in nixos like a, filthy and impure, flakey monster.
  • Typical runtime native dependencies for python ml projects get pulled in when you run nix develop github:fiq/nix-pyenv-flake --impure
  • You can use pyenv without having to worry about identifying which python3xxPackages.* nix packages to install.

Sometimes we need to be dirty and use our existing tool chain.

This is an (impure) nix flake and overlay so that you can use pyenv.

Install

To use pyenv in nix:

nix develop github:fiq/nix-pyenv-flake --impure

Or clone and run nix develop . --impure

This will give you a new shell using the local derivation of pyenv.

Now go forth and be an impure pythonista.

Python Downloads Folder (PYENV_ROOT)

In order to persist python versions, the flake will default your PYENV_ROOT (where python versions are stored) to $HOME/.pyenv

You may create an alternate pyenv by setting it before invoking the flake.

mkdir -p ~/.pyenv-other
export PYENV_ROOT=$HOME/.pyenv-other
nix develop . --impure

Change as appropriate.