2022-03-13 07:16:34 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, callPackage
|
|
|
|
, fetchurl
|
|
|
|
, nixosTests
|
2023-05-31 15:09:50 +00:00
|
|
|
, srcOnly
|
2022-09-03 15:10:49 +00:00
|
|
|
, isInsiders ? false
|
|
|
|
, commandLineArgs ? ""
|
2023-05-29 20:24:02 +00:00
|
|
|
, 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";
|
2020-12-16 16:40:14 +00:00
|
|
|
aarch64-linux = "linux-arm64";
|
2021-07-11 20:51:17 +00:00
|
|
|
aarch64-darwin = "darwin-arm64";
|
2020-12-16 16:40:14 +00:00
|
|
|
armv7l-linux = "linux-armhf";
|
2022-07-26 22:02:37 +00:00
|
|
|
}.${system} or throwSystem;
|
2019-05-21 18:17:01 +00:00
|
|
|
|
2021-07-11 20:51:17 +00:00
|
|
|
archive_fmt = if stdenv.isDarwin then "zip" else "tar.gz";
|
2019-05-21 18:17:01 +00:00
|
|
|
|
|
|
|
sha256 = {
|
2023-08-03 18:39:42 +00:00
|
|
|
x86_64-linux = "0hc1pfrhmdydwgyz3mjp45nmzs101iffam7ciximqmnhf1s1x4qf";
|
|
|
|
x86_64-darwin = "1snrr4lsa5qdpdl80wx8ymxp8h1bhd5ablhcgkhzvmj5dh7jrywk";
|
|
|
|
aarch64-linux = "0pm5znbjm79ziwdx37cc75qnbf0jv3yrm2xg7cykavn43gz97abw";
|
|
|
|
aarch64-darwin = "0bq5hvgv228x7vby4475cc65g24kpv9kvj06p6c0y6a2a79j45by";
|
|
|
|
armv7l-linux = "11gxpqflakp4cwzkpqrwsd6m5fls1vnaigppc4bq9flfknwkjfrx";
|
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-08-03 18:39:42 +00:00
|
|
|
version = "1.81.0";
|
2019-05-21 18:17:01 +00:00
|
|
|
pname = "vscode";
|
|
|
|
|
2023-05-31 15:09:50 +00:00
|
|
|
# This is used for VS Code - Remote SSH test
|
2023-08-03 18:39:42 +00:00
|
|
|
rev = "6445d93c81ebe42c4cbd7a60712e0b17d9463e97";
|
2023-05-31 15:09:50 +00:00
|
|
|
|
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";
|
2021-12-23 22:22:28 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2023-02-14 08:28:42 +00:00
|
|
|
# We don't test vscode on CI, instead we test vscodium
|
|
|
|
tests = {};
|
|
|
|
|
2019-05-21 18:17:01 +00:00
|
|
|
sourceRoot = "";
|
|
|
|
|
2023-05-31 15:09:50 +00:00
|
|
|
# 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-08-03 18:39:42 +00:00
|
|
|
sha256 = "07x9lmkyhra4hplsgdhh97dixsx92i7lab5z5ihs2wqvvzl69ah2";
|
2023-05-31 15:09:50 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-03-13 07:16:34 +00:00
|
|
|
tests = { inherit (nixosTests) vscode-remote-ssh; };
|
|
|
|
|
2021-08-19 10:30:37 +00:00
|
|
|
updateScript = ./update-vscode.sh;
|
2021-05-24 19:46:44 +00:00
|
|
|
|
2022-10-22 17:19:07 +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-11 07:54:33 +00:00
|
|
|
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
|
|
|
|
'';
|
2021-04-27 14:03:07 +00:00
|
|
|
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
|
|
|
|
'';
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://code.visualstudio.com/";
|
|
|
|
downloadPage = "https://code.visualstudio.com/Updates";
|
2019-05-21 18:17:01 +00:00
|
|
|
license = licenses.unfree;
|
2022-03-13 09:38:22 +00:00
|
|
|
maintainers = with maintainers; [ eadwu synthetica maxeaubrey bobby285271 Enzime ];
|
2021-07-11 20:51:17 +00:00
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" "armv7l-linux" ];
|
2019-05-21 18:17:01 +00:00
|
|
|
};
|
|
|
|
}
|