Change:
]; system.checks = singleton (pkgs.runCommand "xkb-validated" { <del> inherit (cfg.xkb) model layout variant options; </del> <ins> inherit (cfg.xkb) dir model layout variant options; </ins> nativeBuildInputs = with pkgs.buildPackages; [ xkbvalidate ]; preferLocalBuild = true; } '' ${optionalString (config.environment.sessionVariables ? XKB_CONFIG_ROOT) "export XKB_CONFIG_ROOT=${config.environment.sessionVariables.XKB_CONFIG_ROOT}" } <del> xkbvalidate "$model" "$layout" "$variant" "$options" </del> <ins> XKB_CONFIG_ROOT="$dir" xkbvalidate "$model" "$layout" "$variant" "$options" </ins> touch "$out" '');

Discussion:
From what I can tell, . As a result, believes my custom keyboard layout does not exist and fails the rebuild of NixOS. (I’m not sure whether this is significant at all, but I noticed that NixOS uses libxkbcommon version 0.7.1 even though 0.7.2 is the most recent release.) Clone as and then ensure contains: Attempting to rebuild produces the following error: (generated by ) system: host os: multi-user?: sandbox: version: channels(root): nixpkgs:
I came across the same issue today while helping a friend migrating to NixOS.. Instead of pointing xkbDir to a path we created a derivation of which contained the additional files required. My current workaround will be to override the dependencies of so that the derived is used while the remaining parts of the system will just the standard version... Not very satisfying but that is the easiest solution that I could come up with.
I am trying to add a new symbol file, but merging xkeyboard config with anything else is a nightmare, and replacing it with something else cause way too much recompilation to be practical. This might be one of the cases where relying on a standard [ath makes sense, unless we could have each program compilation be independent of the xkb directory.
I'm working on a module/option that will (hopefully) allow to install a custom layout declaratively. I found this that describes the basic idea (how to avoid recompiling a ton of packages). I'm trying to inject a whole layout and not just a simple variant but it seems I can't get it right: the file is installed but setxkbmap doesn't load it and provides no helpful information at all. This is the expression so far, if anyone want to try:
There is now an updated version of the post. See
thank you! I have finally got it to actually work. There is still a little problem though: if is true the loadkeys command fails with a strange error: too many (136) entries on one line
The error was specific to my layout, loadkeys didn't like some exotic unicode character.
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below.

Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly: for maintainers and people that previously touched the related code and @ mention them in a comment. on the . on the on .
The patch I mentioned in this thread has since made its way into NixOS as option. This does not fix the issue but provides a way to declaretively install custom layouts and xkbvalidate works in this case.
I think I wrote a commit that happens to fix this issue in PR , would be happy if somebody could try it out.