Mach-nix: Create python environments quick and easy

Awesome! What should one pass as condaChannelsExtra to enable conda-forge?

conda-forge is included by default. Just add it to the providers (like "conda-forge,conda,nixpkgs"). But good point, docs are missing for some of the new stuff ;). In the mean time, scroll up this topic to when conda beta was released. There are some examples included.

1 Like

Is there any way to do mach-nix and have the resulting env use a modified or custom python. Something like python = (enableDebugging pkgs.python39); in the call to mkPythonShell? I want to set up an environment where I can use cygdb in cython and that requires a debugging python.

1 Like

You can make an overlay for nixpkgs which replaces python39 with your debugging python. Then import nixpkgs with that overlay and pass it to mach-nix during import via pkgs argument. If you need further assistance, feel free to open an issue on github.

1 Like

Released 3.4.0 (04 Feb 2022)

aarch64-darwin, nixpkgs provider improvements, bugfixes

Features

  • support conda packages
  • support wheels for apple m1 (aarch64-darwin)

Changes

  • remove support for installing mach-nix via pip
  • updated inputs nixpkgs, pypi-deps-db, conda-channels

Improvements

  • support for PEP600 wheels of format: ‘manylinux_${GLIBCMAJOR}_${GLIBCMINOR}’
  • respect ‘python_requires’ for sdist packages
  • PEP440 compatible pre-release version handling
  • improve handling of python packages from nixpkgs

Fixes

  • fix problem where required dependencies were removed from nixpkgs python modules.
  • prevent package collisions with dependencies from packagesExtra
  • fix version comparison of versions with arbitrary length
  • various fixes for MacOS
  • various fixes for requirements parsing
  • various other fixes

Package Fixes

  • libwebp-base: remove colliding binaries in conda package
  • pyqt5: fix missing wrapQtAppsHook
5 Likes

I am looking for ifcopenshell nixpkgs build method.
occur error collision between python3-x.x.x-env/bin/idle

I’m having a hard time using the latest releases of ifcopenshell.
Both are a bit complicated, but the derivations I use are each:

(python39.withPackages (py-packages: with py-packages; other-modules ++ [ ifcopenshell ]))

and
This is just a wish…
like that other-modules list
I wish mach-modules could be easily removed and pasted.

like,
(python39.withPackages (py-packages: with py-packages; other-modules ++ [ ifcopenshell ] ++ mach-modules ))

In particular, wouldn’t it be better to subtract them as nixpkgs instead of unifying the requirements?