This gives nix a chance to gracefully exit.
This is cleaner, and finally enables writing tests for the nix invoking functions.