In the builder environment, we set a ZB_STORE environment variable to mirror the NIX_STORE environment variable. However, we use ZB_STORE_DIR to mirror the NIX_STORE_DIR environment variable that the Nix CLI uses to determine the store directory. Since we're not tied to backward compatibility at the moment, my instinct is to do something about these environment variables. We have 4 choices AFAICT:
- Do nothing. If there's a compelling use case for using the zb CLI or related tooling inside the sandbox environment, the user must
export ZB_STORE_DIR="$ZB_STORE".
- Set
ZB_STORE_DIR instead of ZB_STORE in the builder environment.
- Change the zb CLI to obey the
ZB_STORE environment variable instead of ZB_STORE_DIR.
- Set both
ZB_STORE and ZB_STORE_DIR in the builder environment. This seems strictly worse than all other options, so I'm taking it off the table.
I'm leaning toward Option 2. ZB_STORE_DIR is a longer but more correct name for this value, and I don't see a compelling reason to have a separate name. If there is a use case for running zb tooling inside a builder with a different store directory, then the builder should probably be setting ZB_STORE_DIR explicitly anyway.
In the builder environment, we set a
ZB_STOREenvironment variable to mirror theNIX_STOREenvironment variable. However, we useZB_STORE_DIRto mirror theNIX_STORE_DIRenvironment variable that the Nix CLI uses to determine the store directory. Since we're not tied to backward compatibility at the moment, my instinct is to do something about these environment variables. We have 4 choices AFAICT:export ZB_STORE_DIR="$ZB_STORE".ZB_STORE_DIRinstead ofZB_STOREin the builder environment.ZB_STOREenvironment variable instead ofZB_STORE_DIR.ZB_STOREandZB_STORE_DIRin the builder environment. This seems strictly worse than all other options, so I'm taking it off the table.I'm leaning toward Option 2.
ZB_STORE_DIRis a longer but more correct name for this value, and I don't see a compelling reason to have a separate name. If there is a use case for running zb tooling inside a builder with a different store directory, then the builder should probably be settingZB_STORE_DIRexplicitly anyway.