Nix flake build suddenly takes forever in GitHub action

Hello friends,

I have a project which builds a rust and a node program into a docker container with a nix flake build. Here is my flake.nix. When I build it locally it takes a reasonable time to build, well under one minute.

Now to the actual problem I need help with: I have a GitHub action build pipeline which builds and publishes the container image. As of recent builds it takes a few hours to build the container image via nix build. As you can see in the history of the runs, I haven’t changed anything related to the build when it started taking so long. Since I use a flake lock and a tagged version of the install nix action I am out of ideas where I should look for further clues.

Thanks in advance for ideas and help :smile:

For some reason the long build also build NodeJS
(/nix/store/i6hr3qai2hc41i8i6a8i3d0rj1gmkxzj-nodejs-18.16.0.drv) while e.g. feat(button): prettify compile button · jgero/j-k-ratio-plus-L@fbfda77 · GitHub doesn’t.

Whatever the reason, it seems the :magic_wand: Magic Cache was just announced in time to ease your woes :slight_smile:


oh wow that looks mega, I’ll check it out further, thanks!

I’m using the magic cache now and magically it works now, thank you very much for you help, much appreciated :smiley: