mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-13 01:03:25 +00:00
74 lines
2.8 KiB
Nix
74 lines
2.8 KiB
Nix
{ stdenv, lib, callPackage, fetchurl
|
|
, isInsiders ? false
|
|
, commandLineArgs ? ""
|
|
}:
|
|
|
|
let
|
|
inherit (stdenv.hostPlatform) system;
|
|
throwSystem = throw "Unsupported system: ${system}";
|
|
|
|
plat = {
|
|
x86_64-linux = "linux-x64";
|
|
x86_64-darwin = "darwin";
|
|
aarch64-linux = "linux-arm64";
|
|
aarch64-darwin = "darwin-arm64";
|
|
armv7l-linux = "linux-armhf";
|
|
}.${system} or throwSystem;
|
|
|
|
archive_fmt = if stdenv.isDarwin then "zip" else "tar.gz";
|
|
|
|
sha256 = {
|
|
x86_64-linux = "1m5mz6wdrivqrw699iivvh62bdn4yzm6hmph455sdyvk5icq59dq";
|
|
x86_64-darwin = "1zn0h9p05kb3fcn816fpxh8asaglycjmpiwkrmxd0s8jwjq7m4gn";
|
|
aarch64-linux = "1gs810iz08jxqfhcgi6ab41m46ib5h3m7i3pnyvlimxx99r5lirf";
|
|
aarch64-darwin = "1dvasr1h28snxi33m6yx95pp3jd4irwy6yav4ilwrcl22cf6ybvi";
|
|
armv7l-linux = "1j5vrpdaqihcr02pdsd5nz07zsk0027xmkfp30npnjy1gjrjvnim";
|
|
}.${system} or throwSystem;
|
|
in
|
|
callPackage ./generic.nix rec {
|
|
# Please backport all compatible updates to the stable release.
|
|
# This is important for the extension ecosystem.
|
|
version = "1.73.1";
|
|
pname = "vscode";
|
|
|
|
executableName = "code" + lib.optionalString isInsiders "-insiders";
|
|
longName = "Visual Studio Code" + lib.optionalString isInsiders " - Insiders";
|
|
shortName = "Code" + lib.optionalString isInsiders " - Insiders";
|
|
inherit commandLineArgs;
|
|
|
|
src = fetchurl {
|
|
name = "VSCode_${version}_${plat}.${archive_fmt}";
|
|
url = "https://update.code.visualstudio.com/${version}/${plat}/stable";
|
|
inherit sha256;
|
|
};
|
|
|
|
sourceRoot = "";
|
|
|
|
updateScript = ./update-vscode.sh;
|
|
|
|
# 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;
|
|
|
|
meta = with lib; {
|
|
description = ''
|
|
Open source source code editor developed by Microsoft for Windows,
|
|
Linux and macOS
|
|
'';
|
|
mainProgram = "code";
|
|
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;
|
|
maintainers = with maintainers; [ eadwu synthetica maxeaubrey bobby285271 ];
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" "armv7l-linux" ];
|
|
};
|
|
}
|