Created
May 24, 2021 11:10
-
-
Save vakili/a7c6a73dc2bbedefaee970d9a86ee630 to your computer and use it in GitHub Desktop.
Python development environment
This file contains 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
# first run the following | |
# $ niv init | |
# $ niv update nixpkgs -b nixpkgs-unstable | |
# then enter the environment by running | |
# $ nix-shell | |
let | |
sources = import ./nix/sources.nix; | |
pkgs = import sources.nixpkgs { }; | |
inherit (pkgs.lib) optional optionals; | |
mach-nix = import (builtins.fetchGit { | |
url = "https://github.com/DavHau/mach-nix/"; | |
# ref = "refs/tags/3.2.0"; | |
ref = "refs/heads/conda-beta"; | |
}) { | |
condaChannelsExtra.conda-forge = [ | |
(builtins.fetchurl "https://conda.anaconda.org/conda-forge/linux-64/repodata.json") | |
(builtins.fetchurl "https://conda.anaconda.org/conda-forge/noarch/repodata.json") | |
]; }; | |
customPython = mach-nix.mkPython { | |
requirements = '' | |
numpy | |
faiss-cpu | |
scikit-learn | |
''; | |
providers = { | |
_default = "conda-forge,wheel,sdist,nixpkgs"; | |
scikitlearn = "conda-forge"; | |
faiss-cpu = "wheel"; | |
}; | |
}; | |
in pkgs.mkShell { | |
buildInputs = with pkgs; | |
[ customPython | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment