clhodapp/nix-runner

Speed up initial run

Closed this issue · 2 comments

Running a nix-runner script on a given host for the first time is not as fast as it could be. Since there isn't a dedicated cache for nix-runner, this means we have to download everything needed to build it from scratch in this situation. That means that every build dependency counts and we should strive to make the footprint as small as possible.

Some ideas:

  1. Stop using resholve. It's a great tool but there probably isn't enough going on here to justify an extra 100mb of dependencies.
  2. Stop using autotools. Similar reason.
  3. Use the system nix instead of an internally-pinned one. This might make the behavior less deterministic but it would make the script WAY faster to run

Shrunk closure by:

  1. Dropping resholve
  2. Dropping autotools
  3. Switching from stdenv.mkDerivation to a raw derivation (so it doesn't put gnu make in the build closure)
  4. Using busybox instead of coreutils and gnused
  5. Switching to nixStatic

I don't know if it's intrinsic or fixable, but busybox is marked linux only and the build fails on macOS.