Skip to content

Consolidate ZB_STORE_DIR and ZB_STORE environment variables #170

@zombiezen

Description

@zombiezen

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:

  1. 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".
  2. Set ZB_STORE_DIR instead of ZB_STORE in the builder environment.
  3. Change the zb CLI to obey the ZB_STORE environment variable instead of ZB_STORE_DIR.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions