-
Notifications
You must be signed in to change notification settings - Fork 1
/
debug.nix
25 lines (19 loc) · 996 Bytes
/
debug.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ lib, pkgs, ... }:
/* Helper to debug the Shadow app */
rec {
/* Wrap the renderer to capture debug logs
Example:
wrapRenderer "preprod"
=> (string)
*/
wrapRenderer = channel: ''
mv $out/opt/shadow-${channel}/resources/app.asar.unpacked/release/native/ShadowPCDisplay \
$out/opt/shadow-${channel}/resources/app.asar.unpacked/release/native/.Shadow-Orig
echo "#!${pkgs.runtimeShell}" > $out/opt/shadow-${channel}/resources/app.asar.unpacked/release/native/ShadowPCDisplay
echo "echo \"\$@\" > /tmp/shadow.current_cmd" >> \
$out/opt/shadow-${channel}/resources/app.asar.unpacked/release/native/ShadowPCDisplay
echo "strace $out/opt/shadow-${channel}/resources/app.asar.unpacked/release/native/.Shadow-Orig \"\$@\" > /tmp/shadow.strace 2>&1" >> \
$out/opt/shadow-${channel}/resources/app.asar.unpacked/release/native/ShadowPCDisplay
chmod +x $out/opt/shadow-${channel}/resources/app.asar.unpacked/release/native/ShadowPCDisplay
'';
}