> In Germany the default for contracts is that you need your employers permission to do side projects.
You generally need to notify your employer if you take on a second (paid) job. The employer may veto that employment, but must specify a good reason (you can't be in competition, exceed the total legal working hours, bring ill repute to your employer, ...), but the default is "allow". Clauses that require approval are generally not enforceable. As always, there are exceptions depending on the exact circumstances. See for example this discussion (in german) https://www.haufe.de/personal/arbeitsrecht/top-thema-nebenbe...
You generally don't need permission to do open source work, though the ownership of inventions that qualify under the ArbnErfG may fall to the employer. As such, it's good to get clarification and explicit approval from your employer beforehands.
(not legal advice, ...)