obfuscate store path for min-copy-closure

otherwise the systemconfig closure drags in a bunch of build system
things (bash, etc) which we don't want or need to copy to the device
This commit is contained in:
Daniel Barlow
2024-10-10 16:25:00 +01:00
parent da1245432e
commit e383f1b3d3
2 changed files with 8 additions and 2 deletions

View File

@@ -83,7 +83,10 @@ in attrset:
$STRIP --remove-section=.note --remove-section=.comment --strip-all makedevs -o $out/bin/activate
ln -s ${s6-init-bin}/bin/init $out/bin/init
cp -p ${writeFennel "restart-services" {} ./restart-services.fnl} $out/bin/restart-services
substitute ${./build-system-install.sh} $out/install.sh --subst-var-by min-copy-closure ${buildPackages.min-copy-closure}
# obfuscate the store path of min-copy-closure so that the output
# closure doesn't include a bunch of build system stuff
f=${buildPackages.min-copy-closure}; f=$(echo $f | sed 's/\(.....\)/\1_/g')
substitute ${./build-system-install.sh} $out/install.sh --subst-var-by min-copy-closure $f
chmod +x $out/install.sh
cat > $out/bin/install <<EOF
#!/bin/sh -e