I don't think this should be regulated at all. Apple should be able to impose their rules in their systems. Let's be clear about this, if people are choosing to buy these black-box closed handheld computing devices, there are consequences that come with that choice.
Apple is more than welcome to put whatever rules they want on their systems. My phone is not their system though, it’s mine! If I want to run tmux/fetchmail/ocamlc on it then it’s my problem not theirs!
Agreed it shouldn't be illegal, but Apple (or any hardware / software maker) should be allowed to do everything in their power to make this extremely inconvenient by putting in hardware blocks, bricking logic, updating their software regularly with new obfuscation techniques, etc. and also, voiding the warranty if there is evidence of tampering with hardware or software.
Why should any company be allowed to intentionally brick a product I own because I am doing something legal with it that they don't like?