···7# Populate passthru.tests
8, tests
900010# 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 )
000000000000109 '';
110111 inherit meta;
···7# Populate passthru.tests
8, tests
910+# 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 '';
125126 inherit meta;