aboutsummaryrefslogtreecommitdiff
path: root/shell.nix
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-05-19 22:27:07 +0200
committerAdrian Kummerlaender2019-05-19 22:27:07 +0200
commita2644fedfb585382d52c4603d8799525753830c7 (patch)
treeb1c919a3915ac6cdba955827d064ed52e7c28a94 /shell.nix
downloadsymlbm_playground-a2644fedfb585382d52c4603d8799525753830c7.tar
symlbm_playground-a2644fedfb585382d52c4603d8799525753830c7.tar.gz
symlbm_playground-a2644fedfb585382d52c4603d8799525753830c7.tar.bz2
symlbm_playground-a2644fedfb585382d52c4603d8799525753830c7.tar.lz
symlbm_playground-a2644fedfb585382d52c4603d8799525753830c7.tar.xz
symlbm_playground-a2644fedfb585382d52c4603d8799525753830c7.tar.zst
symlbm_playground-a2644fedfb585382d52c4603d8799525753830c7.zip
Initial commit
Diffstat (limited to 'shell.nix')
-rw-r--r--shell.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/shell.nix b/shell.nix
new file mode 100644
index 0000000..1b66f29
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,37 @@
+{ pkgs ? import <nixpkgs> { }, ... }:
+
+pkgs.stdenvNoCC.mkDerivation rec {
+ name = "pycl-env";
+ env = pkgs.buildEnv { name = name; paths = buildInputs; };
+
+ buildInputs = let
+ custom-python = let
+ packageOverrides = self: super: {
+ pyopencl = super.pyopencl.overridePythonAttrs(old: rec {
+ buildInputs = with pkgs; [
+ opencl-headers ocl-icd python37Packages.pybind11
+ libGLU_combined
+ ];
+ # Enable OpenGL integration and fix build
+ preBuild = ''
+ python configure.py --cl-enable-gl
+ export HOME=/tmp/pyopencl
+ '';
+ });
+ };
+ in pkgs.python3.override { inherit packageOverrides; };
+
+ in [
+ (custom-python.withPackages (python-packages: with python-packages; [
+ numpy
+ pyopencl
+ pyopengl
+ ]))
+
+ pkgs.opencl-info
+ ];
+
+ shellHook = ''
+ export NIX_SHELL_NAME="${name}"
+ '';
+}