-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathshell.nix
More file actions
57 lines (48 loc) · 1.38 KB
/
shell.nix
File metadata and controls
57 lines (48 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
with import <nixpkgs> {};
mkShell {
NIX_LD_LIBRARY_PATH = lib.makeLibraryPath [
nss
sane-backends
nspr
zlib
libglvnd
gcc
openssl
openssl_legacy
bzip2
libffi
readline
libgcc
ncurses
stdenv.cc
stdenv.cc.libc stdenv.cc.libc_dev
];
buildInputs = [
pkgs.python311
pkgs.python311Packages.pip
pkgs.python311Packages.virtualenv
pkgs.python311Packages.unicurses
pkgs.python311Packages.gnureadline
pkgs.python311Packages.pyopenssl
pkgs.python311Packages.cython
pkgs.python311Packages.cytoolz
pkgs.pythonManylinuxPackages.manylinux2014Package
pkgs.cmake
];
# NIX_LD = builtins.readFile "${stdenv.cc}/nix-support/dynamic-linker";
shellHook = ''
set -e
export LD_LIBRARY_PATH="${pkgs.stdenv.cc.cc.lib.outPath}/lib:${pkgs.pythonManylinuxPackages.manylinux2014Package}/lib:$LD_LIBRARY_PATH";
echo 'Spinning up Python Virtual Environment in .nix-venv directory 🐍'
${pkgs.python311.interpreter} -m venv .nix-venv
export PATH=$PWD/.nix-venv/bin:$PATH
echo "Python version: $(which python) $(python --version)"
echo $(pip show cytoolz)
# Check if poetry is installed
if ! command -v poetry &> /dev/null; then
echo 'Installing poetry 🐍'
.nix-venv/bin/pip install poetry==2.0.1 poetry-core
fi
# Ensure virtual environment dependencies
'';
}