forked from CalciferZh/minimal-hand
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
73 lines (64 loc) · 1.91 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
66
67
68
69
70
71
72
73
{
description = "An awesome machine-learning project";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
utils.url = "github:numtide/flake-utils";
ml-pkgs.url = "github:nixvital/ml-pkgs";
ml-pkgs.inputs.nixpkgs.follows = "nixpkgs";
ml-pkgs.inputs.utils.follows = "utils";
};
outputs = { self, nixpkgs, ... }@inputs: {
overlays.dev = nixpkgs.lib.composeManyExtensions [
inputs.ml-pkgs.overlays.torch-family
inputs.ml-pkgs.overlays.jax-family
inputs.ml-pkgs.overlays.math
# You can put your other overlays here, inline or with import. For example
# if you want to put an inline overlay, uncomment below:
#
# (final: prev: {
# pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
# (python-final: python-prev: {
# my-package = ...;
# })
# ];
# })
];
} // inputs.utils.lib.eachSystem [
"x86_64-linux"
] (system:
let pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
cudaSupport = true;
cudaCapabilities = [ "7.5" "8.6" ];
cudaForwardCompat = true;
};
overlays = [ self.overlays.dev ];
};
in {
devShells.default = let
python-env = pkgs.python3.withPackages (pyPkgs: with pyPkgs; [
numpy
pandas
tensorflowWithCuda
pygame
transforms3d
keyboard
opencv4
chumpy
click
loguru
]);
name = "minimal-hand";
in pkgs.mkShell {
inherit name;
packages = [
python-env
];
shellHooks = let pythonIcon = "f3e2"; in ''
export PS1="$(echo -e '\u${pythonIcon}') {\[$(tput sgr0)\]\[\033[38;5;228m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\]} (${name}) \\$ \[$(tput sgr0)\]"
'';
};
});
}