xin/configs/colemak.nix

56 lines
1.2 KiB
Nix
Raw Normal View History

2023-09-12 08:44:05 -06:00
{ config
, lib
2024-03-06 20:57:33 -07:00
, isUnstable
2023-09-12 08:44:05 -06:00
, ...
2023-07-11 09:12:50 -06:00
}:
2024-03-06 20:57:33 -07:00
let
unstableVariant =
if isUnstable then {
xkb = {
options = "ctrl:swapcaps,compose:ralt";
variant = "colemak";
layout = "us";
};
} else {
xkbVariant = "colemak";
xkbOptions = "ctrl:swapcaps,compose:ralt";
layout = "us";
};
in
2022-08-25 12:21:35 -06:00
with lib; {
options = {
colemak = {
enable = mkOption {
description = "Enable colemak keyboard layout";
default = true;
example = true;
type = lib.types.bool;
};
};
};
config = mkIf config.colemak.enable {
2023-09-12 08:44:05 -06:00
console = { keyMap = "colemak"; };
2022-08-25 12:21:35 -06:00
services.xserver = {
2023-08-11 05:25:58 -06:00
inputClassSections = [
''
Identifier "precursor"
MatchIsKeyboard "on"
MatchProduct "Precursor"
MatchVendor "Kosagi"
Option "XkbLayout" "us"
Option "XkbVariant" "basic"
''
2024-01-14 13:20:54 -07:00
''
Identifier "atreus"
MatchIsKeyboard "on"
MatchProduct "Keyboardio Atreus"
MatchVendor "Keyboardio"
Option "XkbLayout" "us"
Option "XkbVariant" "basic"
''
2023-08-11 05:25:58 -06:00
];
2024-03-06 20:57:33 -07:00
} // unstableVariant;
2022-08-25 12:21:35 -06:00
};
}