Created
January 21, 2026 01:01
-
-
Save emattiza/1961cda28c4e50ffc58a58b8c514e937 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {pkgs ? import <nixpkgs> {}}: let | |
| # 1. Import your custom toolz derivation | |
| toolz-wheel = pkgs.callPackage ./toolz-wheel.nix {}; | |
| # 2. Create a Python environment that includes your wheel | |
| myPython = pkgs.python3.withPackages (ps: [ | |
| toolz-wheel | |
| # You can add other standard packages from nixpkgs here too | |
| ps.requests | |
| ]); | |
| in | |
| pkgs.mkShell { | |
| buildInputs = [ | |
| myPython | |
| ]; | |
| shellHook = '' | |
| echo "Python environment with toolz-wheel loaded!" | |
| python --version | |
| ''; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| lib, | |
| python3Packages, | |
| fetchurl, | |
| }: | |
| python3Packages.buildPythonPackage rec { | |
| pname = "toolz"; | |
| version = "1.1.0"; # Replace with the specific version you need | |
| format = "wheel"; | |
| src = fetchurl { | |
| # The URL pattern for PyPI wheels | |
| url = "https://files.pythonhosted.org/packages/py3/${builtins.substring 0 1 pname}/${pname}/${pname}-${version}-py3-none-any.whl"; | |
| # You must update this hash with the real one (nix-hash --to-sri --type sha256 <hash>) | |
| hash = "sha256-FczIYaxRxTaW3gpdbUYH+ZwhBznK+Ye10gVPPv7UKdg="; | |
| }; | |
| # toolz has no dependencies, but if it did, they'd go here | |
| propagatedBuildInputs = []; | |
| # This ensures the wheel was installed correctly and is accessible | |
| pythonImportsCheck = ["toolz"]; | |
| meta = with lib; { | |
| description = "A functional standard library for Python"; | |
| homepage = "https://github.com/pytoolz/toolz/"; | |
| license = licenses.bsd3; | |
| maintainers = []; | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment