cachix / install-nix-action

Installs Nix on GitHub Actions for the supported platforms: Linux and macOS.
Apache License 2.0
498 stars 78 forks source link

Consider option to set TMPDIR from action #197

Closed jalaziz closed 8 months ago

jalaziz commented 8 months ago

I recently ran into https://github.com/NixOS/nix/issues/395, resulting in an unexpected "out of space" error when running a build in nix-shell despite there being plenty of space on the runner.

While I could set TMPDIR myself, it seems like it may be beneficial to set it from this action as the default nix behavior is not very GitHub Actions Runner friendly.

It seems like the best candidate is setting TMPDIR to $RUNNER_TEMP.

sandydoo commented 8 months ago

@jalaziz, thanks for linking to that issue. The fallback to $XDG_RUNTIME_DIR is problematic. It might be a good idea to set $TMPDIR until https://github.com/NixOS/nix/issues/395 is resolved.

Using $RUNNER_TEMP sounds reasonable to me. @domenkozar, thoughts?

domenkozar commented 8 months ago

If we can set it in the action that would be great.

local testing says

echo $NIX_BUILD_TOP
/run/user/1000