I want to disable, not remap, my caps-lock key while using nixos. I found a few guides to remap caps-lock into ctrl, but I want to just disable it. How can I do it?
There’s like a dozen ways to do this and they all depend on various combinations of window managers, desktop managers, display manger, kernel mods, and any terminal/hardware specific userland software.
If you can describe you setup ( X11, Wayland, DWM ( the correct choice ), Gnome, XMonad, Linux/Darwin, etc ) we can give useful advice.
I am using gnome. Do you need my confifuration.nix file?
You can do that like on any other GNOME-based distro: Open GNOME Tweaks program, in Keyboard & Mouse pane press Additional Layout Option button and then customize the Caps Lock behaviour.
Or on command line, use:
gsettings set org.gnome.desktop.input-sources xkb-options "['caps:none']"
If you want to set it declaratively, look at GSettings section of NixOS manual. The Warning block is very relevant in this case.