nixpkgs/pkgs/applications/editors/vscode/vscode.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

98 lines
3.5 KiB
Nix
Raw Normal View History

{ stdenv
, lib
, callPackage
, fetchurl
, nixosTests
, srcOnly
2022-09-03 15:10:49 +00:00
, isInsiders ? false
, commandLineArgs ? ""
, useVSCodeRipgrep ? stdenv.isDarwin
2022-09-03 15:10:49 +00:00
}:
2019-05-21 18:17:01 +00:00
let
inherit (stdenv.hostPlatform) system;
2022-07-26 22:02:37 +00:00
throwSystem = throw "Unsupported system: ${system}";
2019-05-21 18:17:01 +00:00
plat = {
2019-08-13 21:52:01 +00:00
x86_64-linux = "linux-x64";
x86_64-darwin = "darwin";
aarch64-linux = "linux-arm64";
aarch64-darwin = "darwin-arm64";
armv7l-linux = "linux-armhf";
2022-07-26 22:02:37 +00:00
}.${system} or throwSystem;
2019-05-21 18:17:01 +00:00
archive_fmt = if stdenv.isDarwin then "zip" else "tar.gz";
2019-05-21 18:17:01 +00:00
sha256 = {
2023-07-28 00:28:19 +00:00
x86_64-linux = "05yl6v11ndayz081m3j6dhclj0hshsf0ism7z31hmq6qvfl1sw0k";
x86_64-darwin = "16x1ppfi3n9gnxg2la2pzj67mlj507879hpqinhpz57dvys421h8";
aarch64-linux = "0m5k9rm14isj9x1j3nw3zvcxxz523396id7yhi8bpncr4ac8a087";
aarch64-darwin = "1kbhf3v71qhw4ql6pp8x5m68lgycjzxzm17c9ri0zn0b86ffp8d3";
armv7l-linux = "07lp0schicpnzs52gfbi9y8zfkwxhh92zv29afzy6vxdlqvmrf21";
2022-07-26 22:02:37 +00:00
}.${system} or throwSystem;
2019-05-21 18:17:01 +00:00
in
callPackage ./generic.nix rec {
2020-04-01 04:36:58 +00:00
# Please backport all compatible updates to the stable release.
# This is important for the extension ecosystem.
2023-07-28 00:28:19 +00:00
version = "1.80.2";
2019-05-21 18:17:01 +00:00
pname = "vscode";
# This is used for VS Code - Remote SSH test
2023-07-28 00:28:19 +00:00
rev = "2ccd690cbff1569e4a83d7c43d45101f817401dc";
2019-05-21 18:17:01 +00:00
executableName = "code" + lib.optionalString isInsiders "-insiders";
longName = "Visual Studio Code" + lib.optionalString isInsiders " - Insiders";
shortName = "Code" + lib.optionalString isInsiders " - Insiders";
inherit commandLineArgs useVSCodeRipgrep;
2019-05-21 18:17:01 +00:00
src = fetchurl {
name = "VSCode_${version}_${plat}.${archive_fmt}";
2021-03-24 14:24:12 +00:00
url = "https://update.code.visualstudio.com/${version}/${plat}/stable";
2019-05-21 18:17:01 +00:00
inherit sha256;
};
# We don't test vscode on CI, instead we test vscodium
tests = {};
2019-05-21 18:17:01 +00:00
sourceRoot = "";
# As tests run without networking, we need to download this for the Remote SSH server
vscodeServer = srcOnly {
name = "vscode-server-${rev}.tar.gz";
src = fetchurl {
name = "vscode-server-${rev}.tar.gz";
url = "https://update.code.visualstudio.com/commit:${rev}/server-linux-x64/stable";
2023-07-28 00:28:19 +00:00
sha256 = "1425bngv0n2xpd7yp9xbmxv95adr9vv0vzy1wvqvgpd8p6h05r7n";
};
};
tests = { inherit (nixosTests) vscode-remote-ssh; };
2021-08-19 10:30:37 +00:00
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; {
2019-05-21 18:17:01 +00:00
description = ''
Open source source code editor developed by Microsoft for Windows,
Linux and macOS
'';
mainProgram = "code";
2019-05-21 18:17:01 +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";
2019-05-21 18:17:01 +00:00
license = licenses.unfree;
maintainers = with maintainers; [ eadwu synthetica maxeaubrey bobby285271 Enzime ];
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" "armv7l-linux" ];
2019-05-21 18:17:01 +00:00
};
}