Setups up all the things for you to do python dev, particularly for ML, and just use pip
directly on nixos.
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.
- For when you need to get stuff done and don't want to be faffing with your
default.nix
orflake.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 whichpython3xxPackages.*
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.
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.
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.