forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nixos/kmonad: misc improvements (NixOS#369837)
- Loading branch information
Showing
4 changed files
with
80 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ lib, ... }: | ||
|
||
{ | ||
name = "kmonad"; | ||
|
||
meta = { | ||
maintainers = with lib.maintainers; [ linj ]; | ||
}; | ||
|
||
nodes = { | ||
machine = { | ||
services.kmonad = { | ||
enable = true; | ||
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}") | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters