1{
2 lib,
3 stdenv,
4 callPackage,
5 fetchurl,
6 nixosTests,
7 commandLineArgs ? "",
8 useVSCodeRipgrep ? stdenv.hostPlatform.isDarwin,
9}:
10
11let
12 inherit (stdenv.hostPlatform) system;
13 throwSystem = throw "Unsupported system: ${system}";
14
15 plat =
16 {
17 x86_64-linux = "linux-x64";
18 x86_64-darwin = "darwin-x64";
19 aarch64-linux = "linux-arm64";
20 aarch64-darwin = "darwin-arm64";
21 armv7l-linux = "linux-armhf";
22 }
23 .${system} or throwSystem;
24
25 archive_fmt = if stdenv.hostPlatform.isDarwin then "zip" else "tar.gz";
26
27 hash =
28 {
29 x86_64-linux = "sha256-ihRG4CNWFJ9E+F4cVm9ZWLyssY24POgAePf91cFaj6U=";
30 x86_64-darwin = "sha256-TDbTxuyMLK2z3jn+jDjofX/58gaiGdSWlpXUIZv9U1w=";
31 aarch64-linux = "sha256-NwcDwUc8ZtSXMsURIQjH5eWVzxXMFE4SEX6fi9UoUsc=";
32 aarch64-darwin = "sha256-OupASVZeXIWjnMTUv9la7WMGhCtOoUFIYsTFMHGyEfE=";
33 armv7l-linux = "sha256-kh76i3hxq588to2CNMJWzMB6WZa543phSrbbMxUGnSA=";
34 }
35 .${system} or throwSystem;
36
37 sourceRoot = lib.optionalString (!stdenv.hostPlatform.isDarwin) ".";
38in
39callPackage ./generic.nix rec {
40 inherit sourceRoot commandLineArgs useVSCodeRipgrep;
41
42 # Please backport all compatible updates to the stable release.
43 # This is important for the extension ecosystem.
44 version = "1.102.24914";
45 pname = "vscodium";
46
47 executableName = "codium";
48 longName = "VSCodium";
49 shortName = "vscodium";
50
51 src = fetchurl {
52 url = "https://github.com/VSCodium/vscodium/releases/download/${version}/VSCodium-${plat}-${version}.${archive_fmt}";
53 inherit hash;
54 };
55
56 tests = nixosTests.vscodium;
57
58 updateScript = ./update-vscodium.sh;
59
60 # Editing the `codium` binary (and shell scripts) within the app bundle causes the bundle's signature
61 # to be invalidated, which prevents launching starting with macOS Ventura, because VSCodium is notarized.
62 # See https://eclecticlight.co/2022/06/17/app-security-changes-coming-in-ventura/ for more information.
63 dontFixup = stdenv.hostPlatform.isDarwin;
64
65 meta = {
66 description = ''
67 Open source source code editor developed by Microsoft for Windows,
68 Linux and macOS (VS Code without MS branding/telemetry/licensing)
69 '';
70 longDescription = ''
71 Open source source code editor developed by Microsoft for Windows,
72 Linux and macOS. It includes support for debugging, embedded Git
73 control, syntax highlighting, intelligent code completion, snippets,
74 and code refactoring. It is also customizable, so users can change the
75 editor's theme, keyboard shortcuts, and preferences
76 '';
77 homepage = "https://github.com/VSCodium/vscodium";
78 downloadPage = "https://github.com/VSCodium/vscodium/releases";
79 license = lib.licenses.mit;
80 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
81 maintainers = with lib.maintainers; [
82 synthetica
83 bobby285271
84 ludovicopiero
85 ];
86 mainProgram = "codium";
87 platforms = [
88 "x86_64-linux"
89 "x86_64-darwin"
90 "aarch64-linux"
91 "aarch64-darwin"
92 "armv7l-linux"
93 ];
94 # requires libc.so.6 and other glibc specifics
95 broken = stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isGnu;
96 };
97}