-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
41 lines (34 loc) · 796 Bytes
/
shell.nix
File metadata and controls
41 lines (34 loc) · 796 Bytes
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
{ pkgs ? import <nixpkgs> {} }:
let
python = pkgs.python312;
in
pkgs.mkShell {
buildInputs = [
python
python.pkgs.pip
python.pkgs.setuptools
pkgs.zlib
pkgs.glib
];
# Assure que les libs natives comme libz.so.1 sont visibles
LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [
zlib
stdenv.cc.cc
glib
];
shellHook = ''
if [ ! -d ".venv" ]; then
python -m venv .venv
fi
# Activation venv
if [ -f ".venv/bin/activate" ]; then
source .venv/bin/activate
fi
# Hack pour que venv trouve les libs partagées de Nix
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
# Install deps si pas déjà fait
if [ ! -f ".venv/.installed" ]; then
pip install -r requirements.txt && touch .venv/.installed
fi
'';
}