-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
59 lines (58 loc) · 1.79 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/a983cc62cc2345443620597697015c1c9c4e5b06";
utils.url = "github:numtide/flake-utils/93a2b84fc4b70d9e089d029deacc3583435c2ed6";
};
outputs = {
self,
nixpkgs,
utils,
}: let
out = system: let
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
};
inherit (pkgs) poetry2nix;
mujoco = fetchTarball {
url = "https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz";
sha256 = "sha256:1lvppcdfca460sqnb0ryrach6lv1g9dwcjfim0dl4vmxg2ryaq7p";
};
overrides = pyfinal: pyprev: rec {
bsuite = pyprev.bsuite.overridePythonAttrs (old: {
buildInputs = (old.buildInputs or []) ++ [pyprev.scipy];
});
dollar-lambda = pyprev.dollar-lambda.overridePythonAttrs (old: {
buildInputs = (old.buildInputs or []) ++ [pyprev.poetry];
});
vega-charts = pyprev.vega-charts.overridePythonAttrs (old: {
buildInputs = (old.buildInputs or []) ++ [pyprev.poetry];
});
};
poetryEnv = pkgs.poetry2nix.mkPoetryEnv {
python = pkgs.python39;
projectDir = ./.;
preferWheels = true;
overrides = poetry2nix.overrides.withDefaults overrides;
};
in {
devShell = pkgs.mkShell {
LD_LIBRARY_PATH = "$LD_LIBRARY_PATH:${pkgs.linuxPackages.nvidia_x11}/lib:${pkgs.mesa.osmesa}/lib:${pkgs.libGL}/lib:${pkgs.gcc-unwrapped.lib}/lib";
buildInputs = with pkgs; [
alejandra
poetry
poetryEnv
];
PYTHONBREAKPOINT = "ipdb.set_trace";
shellHook = ''
set -o allexport
source .env
set +o allexport
'';
};
};
in
utils.lib.eachDefaultSystem out;
}