Merge pull request #137912 from pshirshov/wip/vscode-sudo-fix
This commit is contained in:
commit
5c2f59ce3b
1 changed files with 15 additions and 0 deletions
|
@ -7,6 +7,9 @@
|
|||
# Populate passthru.tests
|
||||
, tests
|
||||
|
||||
# needed to fix "Save as Root"
|
||||
, nodePackages, bash
|
||||
|
||||
# Attributes inherit from specific versions
|
||||
, version, src, meta, sourceRoot
|
||||
, executableName, longName, shortName, pname, updateScript
|
||||
|
@ -108,6 +111,18 @@ let
|
|||
)
|
||||
'';
|
||||
|
||||
# See https://github.com/NixOS/nixpkgs/issues/49643#issuecomment-873853897
|
||||
postPatch = ''
|
||||
# this is a fix for "save as root" functionality
|
||||
packed="resources/app/node_modules.asar"
|
||||
unpacked="resources/app/node_modules"
|
||||
${nodePackages.asar}/bin/asar extract "$packed" "$unpacked"
|
||||
substituteInPlace $unpacked/sudo-prompt/index.js \
|
||||
--replace "/usr/bin/pkexec" "/run/wrappers/bin/pkexec" \
|
||||
--replace "/bin/bash" "${bash}/bin/bash"
|
||||
rm -rf "$packed"
|
||||
'';
|
||||
|
||||
inherit meta;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue