From 29d945ce67c986d2698d5ab315ccbe2de9979c3b Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sat, 15 May 2021 11:52:09 +0300 Subject: [PATCH] Fix path to executable in desktop item --- flake.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 409b0f4..9bc655f 100644 --- a/flake.nix +++ b/flake.nix @@ -32,7 +32,8 @@ desktopItem = pkgs.makeDesktopItem { desktopName = "Matlab"; name = "matlab"; - exec = "${builtins.placeholder "out"}/bin/matlab %F"; + # We use substituteInPlace after we run `install` + exec = "@out@/bin/matlab %F"; icon = "matlab"; # Most of the following are copied from octave's desktop launcher categories = "Utility;TextEditor;Development;IDE;"; @@ -48,6 +49,8 @@ inherit targetPkgs; extraInstallCommands = '' install -Dm644 ${desktopItem}/share/applications/matlab.desktop $out/share/applications/matlab.desktop + substituteInPlace $out/share/applications/matlab.desktop \ + --replace "@out@" ${placeholder "out"} install -Dm644 ${./icons/hicolor/256x256/matlab.png} $out/share/icons/hicolor/256x256/matlab.png 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