2022-09-09 14:08:57 +00:00
|
|
|
{ stdenv, lib, callPackage, fetchurl
|
|
|
|
, isInsiders ? false
|
|
|
|
, commandLineArgs ? ""
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
inherit (stdenv.hostPlatform) system;
|
2022-08-12 12:06:08 +00:00
|
|
|
throwSystem = throw "Unsupported system: ${system}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
plat = {
|
|
|
|
x86_64-linux = "linux-x64";
|
|
|
|
x86_64-darwin = "darwin";
|
2020-12-29 15:07:52 +00:00
|
|
|
aarch64-linux = "linux-arm64";
|
2021-07-14 22:03:04 +00:00
|
|
|
aarch64-darwin = "darwin-arm64";
|
2020-12-29 15:07:52 +00:00
|
|
|
armv7l-linux = "linux-armhf";
|
2022-08-12 12:06:08 +00:00
|
|
|
}.${system} or throwSystem;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
archive_fmt = if stdenv.isDarwin then "zip" else "tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
sha256 = {
|
2022-10-21 18:38:19 +00:00
|
|
|
x86_64-linux = "0cf6zlwslii30877p5vb0varxs6ai5r1g9wxx1b45yrmp7rvda91";
|
|
|
|
x86_64-darwin = "0j9kb7j2rvrgc2dzxhi1nzs78lzhpkfk3gcqcq84hcsga0n59y03";
|
|
|
|
aarch64-linux = "1bf2kvnd2pz2sk26bq1wm868bvvmrg338ipysmryilhk0l490vcx";
|
|
|
|
aarch64-darwin = "1rwwrzabxgw2wryi6rp8sc1jqps54p7a3cjpn4q94kds8rk5j0qn";
|
|
|
|
armv7l-linux = "0p2kwfq74lz43vpfh90xfrqsz7nwgcjsvqwkifkchp1m3xnil742";
|
2022-08-12 12:06:08 +00:00
|
|
|
}.${system} or throwSystem;
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
callPackage ./generic.nix rec {
|
|
|
|
# Please backport all compatible updates to the stable release.
|
|
|
|
# This is important for the extension ecosystem.
|
2022-10-21 18:38:19 +00:00
|
|
|
version = "1.72.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "vscode";
|
|
|
|
|
|
|
|
executableName = "code" + lib.optionalString isInsiders "-insiders";
|
|
|
|
longName = "Visual Studio Code" + lib.optionalString isInsiders " - Insiders";
|
|
|
|
shortName = "Code" + lib.optionalString isInsiders " - Insiders";
|
2022-09-09 14:08:57 +00:00
|
|
|
inherit commandLineArgs;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
name = "VSCode_${version}_${plat}.${archive_fmt}";
|
2021-03-20 04:20:00 +00:00
|
|
|
url = "https://update.code.visualstudio.com/${version}/${plat}/stable";
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = "";
|
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
updateScript = ./update-vscode.sh;
|
2021-05-28 09:39:13 +00:00
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
# Editing the `code` binary within the app bundle causes the bundle's signature
|
|
|
|
# to be invalidated, which prevents launching starting with macOS Ventura, because VS Code is notarized.
|
|
|
|
# See https://eclecticlight.co/2022/06/17/app-security-changes-coming-in-ventura/ for more information.
|
|
|
|
dontFixup = stdenv.isDarwin;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = ''
|
|
|
|
Open source source code editor developed by Microsoft for Windows,
|
|
|
|
Linux and macOS
|
|
|
|
'';
|
2021-05-03 20:48:10 +00:00
|
|
|
mainProgram = "code";
|
2020-04-24 23:36:52 +00:00
|
|
|
longDescription = ''
|
|
|
|
Open source source code editor developed by Microsoft for Windows,
|
|
|
|
Linux and macOS. It includes support for debugging, embedded Git
|
|
|
|
control, syntax highlighting, intelligent code completion, snippets,
|
|
|
|
and code refactoring. It is also customizable, so users can change the
|
|
|
|
editor's theme, keyboard shortcuts, and preferences
|
|
|
|
'';
|
|
|
|
homepage = "https://code.visualstudio.com/";
|
|
|
|
downloadPage = "https://code.visualstudio.com/Updates";
|
|
|
|
license = licenses.unfree;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ eadwu synthetica maxeaubrey bobby285271 ];
|
2021-07-14 22:03:04 +00:00
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" "armv7l-linux" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|