-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
99 lines (86 loc) · 2.1 KB
/
flake.nix
File metadata and controls
99 lines (86 loc) · 2.1 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
{
description = "orange-agent - interactive voice agent with voice cloning";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
cudaSupport = true;
};
};
in
{
devShells.${system}.default = pkgs.mkShell {
name = "orange-agent";
buildInputs = with pkgs; [
python312
# cuda toolkit for flash-attn compilation and runtime
cudaPackages.cuda_nvcc
cudaPackages.cuda_cudart
cudaPackages.libcublas
cudaPackages.libcufft
cudaPackages.libcurand
cudaPackages.libcusolver
cudaPackages.libcusparse
cudaPackages.libcusparse_lt
cudaPackages.libcufile
cudaPackages.cuda_cupti
cudaPackages.cudnn
cudaPackages.nccl
# build tools for native extensions
gcc
cmake
ninja
# audio/media libs
sox
ffmpeg
portaudio
libsndfile
libopus
# pipewire/pulse control
pulseaudio
# tools
ollama
ruff
uv
];
shellHook = ''
export CUDA_HOME="${pkgs.cudaPackages.cuda_nvcc}"
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath [
"/run/opengl-driver"
pkgs.stdenv.cc.cc.lib
pkgs.cudaPackages.cuda_cudart
pkgs.cudaPackages.libcublas
pkgs.cudaPackages.libcufft
pkgs.cudaPackages.libcurand
pkgs.cudaPackages.libcusolver
pkgs.cudaPackages.libcusparse
pkgs.cudaPackages.libcusparse_lt
pkgs.cudaPackages.libcufile
pkgs.cudaPackages.cuda_cupti
pkgs.cudaPackages.cudnn
pkgs.cudaPackages.nccl
pkgs.zlib
pkgs.portaudio
pkgs.libsndfile
pkgs.sox
pkgs.libopus
]}''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export TORCH_CUDA_ARCH_LIST="8.9"
export MAX_JOBS="4"
if [ ! -d .venv ]; then
echo "creating python 3.12 venv..."
${pkgs.python312}/bin/python -m venv .venv
fi
source .venv/bin/activate
uv pip install -q -r requirements.txt
uv pip install -q -e .
'';
};
};
}