From a0f354e409f485e9ebf90148025619f6f1eda43d Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 31 Oct 2022 13:56:17 +0200 Subject: [PATCH] Use pkgs.writeScript for the runScript FHS argument It seems it's problematic for FHS to run full scripts, because it `exec`s them internally. Also, for the matlab-shell: Don't source the shellHooksCommon as it's not needed if you install Matlab for the first time. --- flake.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.nix b/flake.nix index 1d1ad6d..739613f 100644 --- a/flake.nix +++ b/flake.nix @@ -118,9 +118,9 @@ install -Dm644 ${./icons/hicolor/512x512/matlab.png} $out/share/icons/hicolor/512x512/matlab.png install -Dm644 ${./icons/hicolor/64x64/matlab.png} $out/share/icons/hicolor/64x64/matlab.png ''; - runScript = runScriptPrefix + '' + runScript = pkgs.writeScript "matlab-runner" (runScriptPrefix + '' exec $INSTALL_DIR/bin/matlab "$@" - ''; + ''); meta = metaCommon // { description = "Matlab itself - the GUI launcher"; }; @@ -128,7 +128,7 @@ packages.x86_64-linux.matlab-shell = pkgs.buildFHSUserEnv { name = "matlab-shell"; inherit targetPkgs; - runScript = shellHooksCommon + '' + runScript = pkgs.writeScript "matlab-shell-runner" '' cat <