Where / How does the Mix environment variable get set?

As it happens I was at the mix intro doc tonight so I came across the Windows equivalent and edited my reply.