nixos-config/nixos/components/gui/kmonad.nix

70 lines
2.6 KiB
Nix
Raw Normal View History

2023-06-02 16:40:40 +02:00
{ config, pkgs, lib, ... }:
2023-06-02 14:08:07 +02:00
{
2023-06-02 16:40:40 +02:00
options.components.gui.kmonad.enable = lib.mkOption {
type = lib.types.bool;
default = config.components.gui.enable;
2023-06-02 16:11:06 +02:00
};
2023-06-02 16:40:40 +02:00
config = lib.mkIf (config.components.gui.kmonad.enable) {
2023-06-07 15:31:47 +02:00
# only needed if you have an UHK
hardware.keyboard.uhk.enable = true;
2023-06-07 16:59:11 +02:00
environment.systemPackages = [ pkgs.unstable.uhk-agent ];
2023-06-07 15:31:47 +02:00
users.users.mainUser.extraGroups = [ "input" ];
2023-06-02 16:40:40 +02:00
services.xserver = {
layout = "us";
xkbOptions = "compose:ralt";
2023-06-02 14:08:07 +02:00
};
2023-06-02 16:40:40 +02:00
services.kmonad = {
enable = true;
keyboards =
let
keyboard = device: leftOfSpace: {
2023-06-02 16:40:40 +02:00
device = device;
extraGroups = [ "video" ];
defcfg = {
enable = true;
fallthrough = true;
allowCommands = true;
};
config = ''
(defsrc
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] \
caps a s d f g h j k l ; ' ret
lsft z x c v b n m , . / rsft
${lib.concatStringsSep " " leftOfSpace} spc ralt rmet cmp rctl
2023-06-02 16:40:40 +02:00
)
(defalias sym (layer-toggle symbols))
(deflayer qwerty
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ] \
esc a s d f g h j k l ; ' ret
lsft z x c v b n m , . / rsft
lctl lalt lmet spc @sym rmet cmp rctrl
2023-06-02 16:40:40 +02:00
)
(deflayer symbols
_ ½ ² ³ _ _ _
_ _ _ _ _ ü _ ö _ _ _ _
caps ä ß _ _ _ _ _ _ _ _ _ _
_ _ _ ¢ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _)
'';
};
in
{
nativ = keyboard "/dev/input/by-path/platform-i8042-serio-0-event-kbd" [ "lctl" "lmet" "lalt" ];
dasKeyboard = keyboard "/dev/input/by-id/usb-Metadot_-_Das_Keyboard_Das_Keyboard-event-kbd" [ "lctl" "lmet" "lalt" ];
uhk = keyboard "/dev/input/by-id/usb-Ultimate_Gadget_Laboratories_UHK_60_v2-if01-event-kbd" [ "lctl" "lalt" "lmet" ];
2023-06-02 16:40:40 +02:00
};
};
2023-06-02 14:08:07 +02:00
};
}