add nix python environment
This commit is contained in:
parent
e420742a41
commit
0ce87451de
2 changed files with 23 additions and 0 deletions
20
default.nix
Normal file
20
default.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
with import <nixpkgs> {};
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "myPythonEnv";
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
python37Full
|
||||||
|
python37Packages.virtualenv
|
||||||
|
];
|
||||||
|
src = null;
|
||||||
|
shellHook = ''
|
||||||
|
if [ ! -d .venv ]; then
|
||||||
|
python -m venv .venv
|
||||||
|
fi
|
||||||
|
source .venv/bin/activate
|
||||||
|
pip install --upgrade pip
|
||||||
|
if [ -s requirements.txt ]; then
|
||||||
|
pip install -r requirements.txt
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
}
|
||||||
3
requirements.txt
Normal file
3
requirements.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
feedparser
|
||||||
|
readability-lxml
|
||||||
|
requests
|
||||||
Loading…
Add table
Add a link
Reference in a new issue