Created
November 28, 2021 09:06
-
-
Save finloop/bd3c64e94ea7f0880e73ab8e1cc9540a to your computer and use it in GitHub Desktop.
Nix-shell: Pycharm + mach-nix config (nixos)
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
let | |
pkgs = import <nixpkgs> { }; | |
mach-nix = import (builtins.fetchGit { | |
url = "https://github.com/DavHau/mach-nix/"; | |
ref = "master"; | |
}) { python = "python38"; }; | |
customPython = mach-nix.mkPython rec { | |
providers._default = "wheel,conda,nixpkgs,sdist"; | |
requirements = builtins.readFile ./requirements.txt; | |
}; | |
in pkgs.mkShell { | |
buildInputs = [ customPython ]; | |
venvDir = "venv38"; | |
src = null; | |
shellHook = '' | |
virtualenv --no-setuptools venv | |
export PATH=$PWD/venv/bin:$PATH | |
export PYTHONPATH=venv/lib/python3.8/site-packages/:$PYTHONPATH | |
''; | |
postShellHook = '' | |
ln -sf ${customPython}/lib/python3.8/site-packages/* ./venv/lib/python3 | |
.8/site-packages | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment