summary refs log tree commit diff
path: root/pkgs/applications/editors/vscode/generic.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/editors/vscode/generic.nix')
-rw-r--r--pkgs/applications/editors/vscode/generic.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/pkgs/applications/editors/vscode/generic.nix b/pkgs/applications/editors/vscode/generic.nix
index 56a81f21feb..a7f9fb328ff 100644
--- a/pkgs/applications/editors/vscode/generic.nix
+++ b/pkgs/applications/editors/vscode/generic.nix
@@ -10,6 +10,9 @@
 # Attributes inherit from specific versions
 , version, src, meta, sourceRoot
 , executableName, longName, shortName, pname, updateScript
+# sourceExecutableName is the name of the binary in the source archive, over
+# which we have no control
+, sourceExecutableName ? executableName
 }:
 
 let
@@ -74,15 +77,15 @@ let
 
     installPhase = ''
       runHook preInstall
-    '' + (if system == "x86_64-darwin" then ''
+    '' + (if stdenv.isDarwin then ''
       mkdir -p "$out/Applications/${longName}.app" $out/bin
       cp -r ./* "$out/Applications/${longName}.app"
-      ln -s "$out/Applications/${longName}.app/Contents/Resources/app/bin/${executableName}" $out/bin/${executableName}
+      ln -s "$out/Applications/${longName}.app/Contents/Resources/app/bin/${sourceExecutableName}" $out/bin/${executableName}
     '' else ''
       mkdir -p $out/lib/vscode $out/bin
       cp -r ./* $out/lib/vscode
 
-      ln -s $out/lib/vscode/bin/${executableName} $out/bin
+      ln -s $out/lib/vscode/bin/${sourceExecutableName} $out/bin/${executableName}
 
       mkdir -p $out/share/applications
       ln -s $desktopItem/share/applications/${executableName}.desktop $out/share/applications/${executableName}.desktop