

I use keyd for software remapping now, and I like it a lot more than xkb’s esoteric options. It has functionality for layers like layer:C, where any “passthrough” input will have the defined modifier (or combo like C-S-M), but you can define whatever other bindings inside.
Long story short, I’ve used it to remap caps, control, shift (with a custom shift layer for some symbols), and meta, with overloads, double tap/hold into layers, oneshots, timeouts, and all sorts of (surprisingly fluid) nonsense. It’s so much easier than wading through xkb options for me.
To sidestep the question slightly less, I always got rid of capslock altogether instead of swapping. That still leaves true escape to be hit accidentally, but I think there should be an option to change escape too?
Edit: what I always used was
# make CapsLock behave like Ctrl:
setxkbmap -option ctrl:nocaps
# make short-pressed Ctrl behave like Escape:
xcape -e 'Control_L=Escape'
from here
I’ve been eyeing Guix for a while but haven’t jumped in yet. Honestly, I feel like I’m finally getting comfortable with nixos and flakes over the years. There’s quite a bit of un/relearning to do, and I can’t tell if the flow of Guix’s channels/inferiors would match the ease of composability that I like with flakes. The lock system really does it for me and I don’t like the idea of hunting down refs to pin manually or maintaining my own frankenstein repo (other than my config).
That said, I do use emacs and actually like lisp, so I’m torn right now.