I have following layout layouts/en_ru
xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_geometry { include "pc(pc104)" };
xkb_types { include "complete" };
xkb_compat { include "complete" };
xkb_symbols {
include "pc+us+ru:2+inet(evdev)"
include "group(rctrl_rshift_toggle)"
include "capslock(swapescape)"
// swap right alt and left control
replace key <RALT> { [ Control_L ] };
modifier_map Control { <RALT> };
// swap ; and : only in us layout
replace key <AC10> { [ colon, semicolon ],
[ Cyrillic_zhe, Cyrillic_ZHE ] };
// helpers //
// xinput list
// xinput test 16
// xkbcomp $DISPLAY out.xkb
// cat /usr/share/X11/xkb/rules/base.lst
};
};
which is loaded in $HOME/xinitrc
like this
xkbcomp $HOME/.config/layouts/en_ru $DISPLAY
How to move all this to configuration.nix
?
I have made first part of this happen by adding
xserver = {
enable = true;
layout = "us,ru";
xkbOptions = "caps:swapescape,grp:rctrl_rshift_toggle";
};
to my configuration.nix
, but I don't know how to add this part and make it system wide
// swap right alt and left control
replace key <RALT> { [ Control_L ] };
modifier_map Control { <RALT> };
// swap ; and : only in us layout
replace key <AC10> { [ colon, semicolon ],
[ Cyrillic_zhe, Cyrillic_ZHE ] };
Best Answer
This is a temporary issue. A fix is in systemd, but the version of systemd isn't in NixOS yet:
https://github.com/systemd/systemd/commit/5016eb56352a7ea1f61ea106fa4f5639fbf6ddd8
I know what you're saying! "That's not an answer!" and I agree! Luckily, we have the option
services.udev.extraHwdb
, where we can add our own udev rules inconfiguartion.nix
.Here's the final fix that I have working now: