-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
42 lines (38 loc) · 808 Bytes
/
shell.nix
File metadata and controls
42 lines (38 loc) · 808 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
42
let
pkgs = import <nixpkgs> { };
python = pkgs.python313;
pythonPackages = python.pkgs;
lib-path =
with pkgs;
lib.makeLibraryPath [
libffi
openssl
stdenv.cc.cc
];
in
with pkgs;
mkShell {
packages = [
python313Packages.edge-tts
pythonPackages.venvShellHook
];
buildInputs = [
readline
libffi
git
];
shellHook = ''
SOURCE_DATE_EPOCH=$(date +%s)
export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${lib-path}"
VENV=.venv
if test ! -d $VENV; then
python3.13 -m venv $VENV
fi
source ./$VENV/bin/activate
export PYTHONPATH=`pwd`/$VENV/${python.sitePackages}/:$PYTHONPATH
# pip3 install -r requirements.txt
'';
postShellHook = ''
ln -sf ${python.sitePackages}/* ./.venv/lib/python3.13/site-packages
'';
}