diff --git a/pkgs/applications/editors/vscode/generic.nix b/pkgs/applications/editors/vscode/generic.nix index 91479c2c95f3..b2686a9df4e6 100644 --- a/pkgs/applications/editors/vscode/generic.nix +++ b/pkgs/applications/editors/vscode/generic.nix @@ -2,7 +2,11 @@ stdenv, lib, coreutils, + gawk, gnugrep, + gnused, + glibc, + jq, copyDesktopItems, makeDesktopItem, unzip, @@ -33,6 +37,7 @@ openssl, webkitgtk_4_1, ripgrep, + which, # needed to fix "Save as Root" asar, @@ -269,6 +274,7 @@ stdenv.mkDerivation ( autoPatchelfHook asar copyDesktopItems + jq # override doesn't preserve splicing https://github.com/NixOS/nixpkgs/issues/132651 # Has to use `makeShellWrapper` from `buildPackages` even though `makeShellWrapper` from the inputs is spliced because `propagatedBuildInputs` would pick the wrong one because of a different offset. (buildPackages.wrapGAppsHook3.override { makeWrapper = buildPackages.makeShellWrapper; }) @@ -352,9 +358,13 @@ stdenv.mkDerivation ( # for moving files to trash glib - # for launcher script + # for launcher and bundled helper scripts + gawk + glibc.bin gnugrep + gnused coreutils + which ] } --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true --wayland-text-input-version=3}}" @@ -365,9 +375,15 @@ stdenv.mkDerivation ( # See https://github.com/NixOS/nixpkgs/issues/49643#issuecomment-873853897 # linux only because of https://github.com/NixOS/nixpkgs/issues/138729 postPatch = - # this is a fix for "save as root" functionality lib.optionalString stdenv.hostPlatform.isLinux ( + # disable update checks '' + tmpProductJson="$(mktemp)" + jq 'del(.updateUrl, .backupUpdateUrl)' resources/app/product.json > "$tmpProductJson" + mv "$tmpProductJson" resources/app/product.json + '' + # this is a fix for "save as root" functionality + + '' packed="resources/app/node_modules.asar" unpacked="resources/app/node_modules" asar extract "$packed" "$unpacked" diff --git a/pkgs/by-name/an/antigravity/package.nix b/pkgs/by-name/an/antigravity/package.nix index 1c6b5427ea99..a0d5cd05a137 100644 --- a/pkgs/by-name/an/antigravity/package.nix +++ b/pkgs/by-name/an/antigravity/package.nix @@ -3,7 +3,6 @@ stdenv, buildVscode, fetchurl, - jq, writeShellScript, coreutils, commandLineArgs ? "", @@ -17,7 +16,7 @@ let information.sources."${hostPlatform.system}" or (throw "antigravity: unsupported system ${hostPlatform.system}"); in -(buildVscode { +buildVscode { inherit commandLineArgs useVSCodeRipgrep; inherit (information) version vscodeVersion; pname = "antigravity"; @@ -75,15 +74,4 @@ in Zaczero ]; }; -}).overrideAttrs - (oldAttrs: { - # Disable update checks - nativeBuildInputs = (oldAttrs.nativeBuildInputs or [ ]) ++ [ jq ]; - postPatch = (oldAttrs.postPatch or "") + '' - productJson="${ - if stdenv.hostPlatform.isDarwin then "Contents/Resources" else "resources" - }/app/product.json" - data=$(jq 'del(.updateUrl)' "$productJson") - echo "$data" > "$productJson" - ''; - }) +} diff --git a/pkgs/by-name/co/code-cursor/package.nix b/pkgs/by-name/co/code-cursor/package.nix index edff54ed1988..502a8765c5f7 100644 --- a/pkgs/by-name/co/code-cursor/package.nix +++ b/pkgs/by-name/co/code-cursor/package.nix @@ -11,7 +11,6 @@ let inherit (stdenv) hostPlatform; - finalCommandLineArgs = "--update=false " + commandLineArgs; sourcesJson = lib.importJSON ./sources.json; sources = lib.mapAttrs ( @@ -24,9 +23,8 @@ let source = sources.${hostPlatform.system}; in buildVscode rec { - inherit useVSCodeRipgrep; + inherit commandLineArgs useVSCodeRipgrep; inherit (sourcesJson) version vscodeVersion; - commandLineArgs = finalCommandLineArgs; pname = "cursor";