2022-04-05 19:42:32 +02:00
|
|
|
{ pkgs, lib, ... }:
|
|
|
|
let
|
|
|
|
kmonadRoot = ../../dotfiles/kmonad;
|
|
|
|
kmonadInstances = [{
|
|
|
|
config = kmonadRoot + "/keymap.kbd";
|
|
|
|
inputDevices = [
|
|
|
|
"/dev/input/by-path/platform-i8042-serio-0-event-kbd"
|
|
|
|
];
|
|
|
|
}];
|
|
|
|
|
|
|
|
createKmonadInstances = ({ config, inputDevices }:
|
|
|
|
let
|
|
|
|
configContent = builtins.readFile config;
|
|
|
|
in
|
|
|
|
lib.lists.map
|
|
|
|
(device:
|
|
|
|
"${pkgs.writeTextDir "configs/kmonad.kbd" (builtins.replaceStrings [ "$DEVICE" ] [ device ] configContent)}/kmonad.kbd"
|
|
|
|
)
|
|
|
|
inputDevices
|
|
|
|
|
|
|
|
);
|
|
|
|
in
|
2022-04-04 01:10:26 +02:00
|
|
|
{
|
|
|
|
users.extraUsers.adrielus.extraGroups = [ "input" "uinput" ];
|
|
|
|
|
|
|
|
services = {
|
|
|
|
kmonad = {
|
|
|
|
enable = true;
|
2022-04-05 19:42:32 +02:00
|
|
|
# configfiles = lib.lists.concatMap createKmonadInstances kmonadInstances;
|
|
|
|
configfiles = lib.lists.map ({ config, ... }: config) kmonadInstances;
|
2022-04-04 01:10:26 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
xserver = {
|
|
|
|
xkbOptions = "compose:ralt";
|
|
|
|
layout = "us";
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
home-manager.users.adrielus = {
|
|
|
|
home.file.".XCompose".source = kmonadRoot + "/xcompose";
|
|
|
|
};
|
|
|
|
}
|