-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
66 lines (54 loc) · 1.44 KB
/
flake.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
63
64
65
{
description = "PyTorch with CUDA";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { self, nixpkgs }:
let
# Supported systems
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
# Helper function to generate outputs for each system
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
# Import nixpkgs for each system
pkgsFor = system: import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in
{
devShells = forAllSystems (system:
let
pkgs = pkgsFor system;
in
{
default = pkgs.mkShell {
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
pkgs.stdenv.cc.cc
pkgs.zlib
pkgs.libGL
pkgs.glib
"/run/opengl-driver"
];
venvDir = ".venv";
packages = with pkgs; [
python312
python312Packages.venvShellHook
python312Packages.pip
uv
figlet
];
shellHook = ''
figlet RAG env
if [ ! -d ".venv" ]; then
uv venv .venv
fi
source .venv/bin/activate
# alias pip="uv pip"
uv pip install -r requirements.txt
figlet RAG started
'';
};
}
);
};
}