Files
niphas/packages/keyboardScripts.nix

39 lines
870 B
Nix
Raw Normal View History

2026-03-17 23:06:15 +01:00
{ pkgs, lib }:
let
keyboards = {
german = {
code = "de";
variant = "T3";
};
russian = {
code = "ru";
variant = "phonetic_winkeys";
};
greek = {
code = "gr";
variant = "polytonic";
};
};
keyboardScripts = lib.mapAttrs' (
name: keyboard:
lib.nameValuePair "kb-${name}" (
pkgs.writers.writeDashBin "kb-${name}" ''
exec ${lib.getExe pkgs.niphas-niri} msg action load-config-file --path ${
pkgs.niphas-niri-config-with {
input = {
keyboard = {
xkb.layout = "de,${keyboard.code}";
xkb.variant = "T3,${keyboard.variant}";
xkb.options = "compose:caps,grp:ctrls_toggle";
numlock = null;
};
};
}
}
''
)
) keyboards;
in
keyboardScripts