Skip to content

Commit bd5beb3

Browse files
committed
[DDW-1083] Decrease Linux closure (installer) size
1 parent 57ad688 commit bd5beb3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

nix/x86_64-linux.nix

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,19 @@ in rec {
137137
138138
chmod -R +w $out
139139
140+
# XXX: they increase the closure (i.e. installer) size greatly:
141+
echo 'Deleting all redundant /nix/store references from to-be-distributed ‘node_modules/’:'
142+
(
143+
cd $out/share/daedalus/
144+
find node_modules -type f '(' -name '*.o' -o -name '*.o.d' -o -name '*.target.mk' -o -name '*.Makefile' -o -name 'Makefile' -o -name 'config.gypi' ')' -exec rm -vf '{}' ';'
145+
146+
# Get rid of ${nodejs}, too – another 60 MiB:
147+
cd node_modules/
148+
for file in $(grep -RF ${nodejs} . 2>/dev/null | cut -d: -f1) ; do
149+
sed -r 's,^#!${nodejs}/bin/,#!/usr/bin/env ,g' -i "$file"
150+
done
151+
)
152+
140153
mkdir -p $out/share/daedalus/node_modules/usb/build
141154
cp node_modules/usb/build/Debug/usb_bindings.node $out/share/daedalus/node_modules/usb/build
142155

0 commit comments

Comments
 (0)