From f2f21f3b18d205e1dd37e550518c417d6332156e Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 7 Mar 2022 14:18:22 +0200 Subject: [PATCH] Add python matlab engine support Further addresses #3. --- flake.nix | 80 +++++++++++++++++++++++++++++------ python-no_arch.txt-file.patch | 34 +++++++++++++++ 2 files changed, 101 insertions(+), 13 deletions(-) create mode 100644 python-no_arch.txt-file.patch diff --git a/flake.nix b/flake.nix index 4737424..fb78b84 100644 --- a/flake.nix +++ b/flake.nix @@ -55,6 +55,16 @@ "plotting" ]; }; + # Might be useful for usage of this flake in another flake with devShell + + # direnv setup. See: + # https://gitlab.com/doronbehar/nix-matlab/-/merge_requests/1#note_631741222 + shellHooksCommon = runScriptPrefix + '' + export C_INCLUDE_PATH=$INSTALL_DIR/extern/include:$C_INCLUDE_PATH + export CPLUS_INCLUDE_PATH=$INSTALL_DIR/extern/include:$CPLUS_INCLUDE_PATH + # Rename the variable for others to extend it in their shellHook + export MATLAB_INSTALL_DIR="$INSTALL_DIR" + unset INSTALL_DIR + ''; in { packages.x86_64-linux.matlab = pkgs.buildFHSUserEnv { @@ -75,7 +85,7 @@ packages.x86_64-linux.matlab-shell = pkgs.buildFHSUserEnv { name = "matlab-shell"; inherit targetPkgs; - runScript = runScriptPrefix + '' + runScript = shellHooksCommon + '' cat <