For people that type a lot using Level 3 (e.g. using the QWERTZ layout), AltGr on Caps is probably more important. On NixOS, it’s set with two options:
{
services.xserver.xkb.options = "lv3:caps_switch_capslock_with_ctrl";
console.useXkbConfig = true;
}
The kernel console REALLY doesn’t like E1 putting the lv5 switch on <M-f>, and instead deletes the f key, so don’t use the second option if your layout does that. (Just try it out and don’t gc until you’ve verified all keys work.)










The position of Caps Lock is because on mechanical typewriters, the shift lock key physically held down Shift using a push-to-toggle mechanism. (Windows’ default German layout still does that! “German extended (E1)” and “German (IBM)”, aka DIN T1, don’t.)