I’m looking to use keyd[1] to manage my keymappings as I do under another distribution. It is a daemon I guess that intercepts keypresses and remaps them. I like it because it works in framebuffer consoles, etc., not just in a graphical session.
I have managed to get the desired text contents into exactly this path: /etc/keyd/default.conf
However, when I reboot, I notice my config doesn’t seem to work. Capslock is not overridden, grr
It looks like there is no service running for keyd (it doesn’t show in the output of ps -aux, nor in that of systemctl list-units --all).
I have tried throwing services.keyd.enable = true; right under the line for sshd, but no dice. I do get an error, however:
[hb@nixos:~]$ sudo nixos-rebuild switch
[sudo] password for hb:
error: The option `services.keyd' does not exist. Definition values:
- In `/etc/nixos/configuration.nix':
{
enable = true;
}
(use '--show-trace' to show detailed location information)
building Nix...
error: The option `services.keyd' does not exist. Definition values:
- In `/etc/nixos/configuration.nix':
{
enable = true;
}
(use '--show-trace' to show detailed location information)
building the system configuration...
error: The option `services.keyd' does not exist. Definition values:
- In `/etc/nixos/configuration.nix':
{
enable = true;
}
(use '--show-trace' to show detailed location information)
You can’t just services.keyd.enable = true, that setting has to be defined by a module. And there’s no keyd module in nixos (22.11 at least), though there is a package. It looks like someone made a PR for a module but it got marked as merged incorrectly: https://github.com/NixOS/nixpkgs/pull/158793
What about kanata? It has similar functionalities with keyd and has a nixos module (I am the author of the module), which means you can use services.kanata to enable it.