forked from aarnphm/whispercpp
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
62 lines (48 loc) · 1.43 KB
/
shell.nix
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
57
58
59
60
61
62
{ sources ? import ./nix/sources.nix, pkgs ? import sources.nixpkgs {
overlays = [ ];
config = { };
} }:
with pkgs;
let
lib = import <nixpkgs/lib>;
inherit (lib) optional optionals;
basePackages = with pkgs; [
(python310.withPackages (ps: with ps; [ pynvim pip virtualenv ipython ]))
git
bazel_6
nixfmt
treefmt
which
# Without this, we see a whole bunch of warnings about LANG, LC_ALL and locales in general.
# The solution is from: https://github.com/NixOS/nix/issues/318#issuecomment-52986702
glibcLocales
coreutils
ffmpeg
];
env = buildEnv {
name = "whispercpp-environment";
paths = basePackages ++ lib.optional stdenv.isLinux inotify-tools
++ lib.optionals stdenv.isDarwin
(with darwin.apple_sdk.frameworks; [ CoreFoundation CoreServices ]);
};
in stdenv.mkDerivation rec {
name = "python-environment";
phases = [ "nobuild" ];
buildInputs = [ env ];
enableParallelBuilding = true;
shellHook = ''
if [[ ! -d venv ]]; then
python -m virtualenv venv --download
source venv/bin/activate
else
source venv/bin/activate
fi
bazel run //requirements:pypi.update
pip install -r ./requirements/bazel-pypi.lock.txt
'';
LOCALE_ARCHIVE =
if stdenv.isLinux then "${glibcLocales}/lib/locale/locale-archive" else "";
nobuild = ''
echo Do not run this derivation with nix-build, it can only be used with nix-shell
'';
}