-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
48 lines (47 loc) · 1.54 KB
/
shell.nix
File metadata and controls
48 lines (47 loc) · 1.54 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
{ bootstrap ? import <nixpkgs> {} }:
let
#pkgs_source = fetchTarball "https://github.com/NixOS/nixpkgs/archive/dfa8e8b9bc4a18bab8f2c55897b6054d31e2c71b.tar.gz";
#pkgs_source = fetchTarball "https://github.com/NixOS/nixpkgs/archive/refs/tags/22.05.tar.gz";
pkgs_source = fetchTarball "https://github.com/NixOS/nixpkgs/archive/refs/tags/21.11.tar.gz";
overlays = [
(self: super: # define our local packages
{
python3 = super.python3.override {
packageOverrides = python-self: python-super: {
torchtext = python-self.callPackage /opt/nix/torchtext-0.4.0.nix { };
};};})
((import /opt/nix/nvidia-current.nix ) pkgs_source ) # fix version of nvidia drivers
(self: super: {
cudatoolkit = super.cudatoolkit_10; # fix version of cuda
cudnn = super.cudnn_cudatoolkit_10;})
];
config = {
allowUnfree = true;
cudaSupport = true;
};
pkgs = import pkgs_source {inherit overlays; inherit config;};
py = pkgs.python3;
pyEnv = py.buildEnv.override {
extraLibs = with py.pkgs;
[
pytorch
torchtext
notebook
matplotlib
pandas
scikitlearn
plotly
statsmodels
numpy
];
ignoreCollisions = true;};
in
pkgs.stdenv.mkDerivation {
name = "sh-env";
buildInputs = [pyEnv pkgs.htop pkgs.ranger];
shellHook = ''
export LANG=en_US.UTF-8
export PYTHONIOENCODING=UTF-8
export LD_PRELOAD=/lib64/libcuda.so.1
'';
}