Merge pull request #137912 from pshirshov/wip/vscode-sudo-fix

authored by

Artturi and committed by
GitHub
5c2f59ce e5c5c3b1

+15
+15
pkgs/applications/editors/vscode/generic.nix
··· 7 # Populate passthru.tests 8 , tests 9 10 # Attributes inherit from specific versions 11 , version, src, meta, sourceRoot 12 , executableName, longName, shortName, pname, updateScript ··· 106 # Add gio to PATH so that moving files to the trash works when not using a desktop environment 107 --prefix PATH : ${glib.bin}/bin 108 ) 109 ''; 110 111 inherit meta;
··· 7 # Populate passthru.tests 8 , tests 9 10 + # needed to fix "Save as Root" 11 + , nodePackages, bash 12 + 13 # Attributes inherit from specific versions 14 , version, src, meta, sourceRoot 15 , executableName, longName, shortName, pname, updateScript ··· 109 # Add gio to PATH so that moving files to the trash works when not using a desktop environment 110 --prefix PATH : ${glib.bin}/bin 111 ) 112 + ''; 113 + 114 + # See https://github.com/NixOS/nixpkgs/issues/49643#issuecomment-873853897 115 + postPatch = '' 116 + # this is a fix for "save as root" functionality 117 + packed="resources/app/node_modules.asar" 118 + unpacked="resources/app/node_modules" 119 + ${nodePackages.asar}/bin/asar extract "$packed" "$unpacked" 120 + substituteInPlace $unpacked/sudo-prompt/index.js \ 121 + --replace "/usr/bin/pkexec" "/run/wrappers/bin/pkexec" \ 122 + --replace "/bin/bash" "${bash}/bin/bash" 123 + rm -rf "$packed" 124 ''; 125 126 inherit meta;