California law expressly prohibits this exact policy. If you want to be able to work on open source (that is unrelated to your job, on your own equipment) on your own time, move to Silicon Valley.
Even Amazon employees in CA should be exempt from this policy.