Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
53 lines
1.3 KiB
Nix
53 lines
1.3 KiB
Nix
{ lib, ... }:
|
|
|
|
{
|
|
name = "kmonad";
|
|
|
|
meta = {
|
|
maintainers = with lib.maintainers; [ linj ];
|
|
};
|
|
|
|
nodes = {
|
|
machine = {
|
|
services.kmonad = {
|
|
enable = true;
|
|
extraArgs = [
|
|
"--log-level=debug"
|
|
];
|
|
keyboards = {
|
|
defaultKbd = {
|
|
device = "/dev/input/by-id/vm-default-kbd";
|
|
defcfg = {
|
|
enable = true;
|
|
fallthrough = true;
|
|
};
|
|
config = ''
|
|
(defsrc :name default-src
|
|
1)
|
|
(deflayer default-layer :source default-src
|
|
@T2)
|
|
(defalias
|
|
T2 2)
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
|
|
# make a determinate symlink to the default vm keyboard for kmonad to use
|
|
services.udev.extraRules = ''
|
|
ACTION=="add", KERNEL=="event*", SUBSYSTEM=="input", ATTRS{name}=="QEMU Virtio Keyboard", ATTRS{id/product}=="0001", ATTRS{id/vendor}=="0627", SYMLINK+="input/by-id/vm-default-kbd"
|
|
'';
|
|
};
|
|
};
|
|
|
|
testScript = ''
|
|
service_name = "kmonad-defaultKbd"
|
|
machine.wait_for_unit(f"{service_name}.service")
|
|
|
|
with subtest("kmonad is running"):
|
|
machine.succeed(f"systemctl status {service_name}")
|
|
with subtest("kmonad symlink is created"):
|
|
machine.wait_for_file(f"/dev/input/by-id/{service_name}", timeout=5)
|
|
'';
|
|
}
|