diff --git a/pkgs/applications/editors/vscode/generic.nix b/pkgs/applications/editors/vscode/generic.nix index b4731b5701c9..92c2a5daffeb 100644 --- a/pkgs/applications/editors/vscode/generic.nix +++ b/pkgs/applications/editors/vscode/generic.nix @@ -11,7 +11,7 @@ , nodePackages, bash # Attributes inherit from specific versions -, version, src, meta, sourceRoot +, version, src, meta, sourceRoot, commandLineArgs , executableName, longName, shortName, pname, updateScript # sourceExecutableName is the name of the binary in the source archive, over # which we have no control @@ -110,6 +110,7 @@ let # Add gio to PATH so that moving files to the trash works when not using a desktop environment --prefix PATH : ${glib.bin}/bin --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}" + --add-flags ${lib.escapeShellArg commandLineArgs} ) ''; diff --git a/pkgs/applications/editors/vscode/vscode.nix b/pkgs/applications/editors/vscode/vscode.nix index 9f3ebcd916f7..a0ffaf348d06 100644 --- a/pkgs/applications/editors/vscode/vscode.nix +++ b/pkgs/applications/editors/vscode/vscode.nix @@ -1,4 +1,7 @@ -{ stdenv, lib, callPackage, fetchurl, isInsiders ? false }: +{ stdenv, lib, callPackage, fetchurl +, isInsiders ? false +, commandLineArgs ? "" +}: let inherit (stdenv.hostPlatform) system; @@ -31,6 +34,7 @@ in 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}"; diff --git a/pkgs/applications/editors/vscode/vscodium.nix b/pkgs/applications/editors/vscode/vscodium.nix index e8043eef9fac..fd912beb6acd 100644 --- a/pkgs/applications/editors/vscode/vscodium.nix +++ b/pkgs/applications/editors/vscode/vscodium.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, callPackage, fetchurl, nixosTests }: +{ lib, stdenv, callPackage, fetchurl, nixosTests, commandLineArgs ? "" }: let inherit (stdenv.hostPlatform) system; @@ -25,7 +25,7 @@ let sourceRoot = if stdenv.isDarwin then "" else "."; in callPackage ./generic.nix rec { - inherit sourceRoot; + inherit sourceRoot commandLineArgs; # Please backport all compatible updates to the stable release. # This is important for the extension ecosystem.