From 7ac19a64ea46a00132518dd78ffe2c22d9f6899b Mon Sep 17 00:00:00 2001 From: Emin Date: Tue, 13 Oct 2026 15:04:47 +0800 Subject: [PATCH] vscode: preserve permissions of unpacked ASAR files --- pkgs/applications/editors/vscode/generic.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/applications/editors/vscode/generic.nix b/pkgs/applications/editors/vscode/generic.nix index 67a664fce5c4..c501646269ec 100644 --- a/pkgs/applications/editors/vscode/generic.nix +++ b/pkgs/applications/editors/vscode/generic.nix @@ -414,6 +414,13 @@ stdenv.mkDerivation ( packed="resources/app/node_modules.asar" unpacked="resources/app/node_modules" asar extract "$packed" "$unpacked" + + # FIXME: drop this when `asar extract` preserves the mode of unpacked files in + # the archives Microsoft ships, fixes https://github.com/NixOS/nixpkgs/issues/573021 + if [ -d "$packed.unpacked" ]; then + cp -a "$packed.unpacked/." "$unpacked/" + fi + substituteInPlace $unpacked/@vscode/sudo-prompt/index.js \ --replace-fail "/usr/bin/pkexec" "/run/wrappers/bin/pkexec" \ --replace-fail "/bin/bash" "${bash}/bin/bash"