nixos-config/config/programs/plover.nix

82 lines
2.9 KiB
Nix
Raw Normal View History

2022-06-12 15:39:15 +00:00
{
lib,
pkgs,
2022-06-16 20:47:46 +00:00
system,
2022-07-06 18:25:34 +00:00
nix-packages,
emily-modifiers,
emily-symbols,
2022-06-12 15:39:15 +00:00
...
}: let
2023-07-10 18:10:12 +00:00
plover-env = pkgs.plover.pythonModule.withPackages (_:
with pkgs; [
plover
plover-plugins-manager
plover-plugin-emoji
plover-plugin-tapey-tape
plover-plugin-yaml-dictionary
plover-plugin-rkb1-hid
plover-plugin-python-dictionary
plover-plugin-stenotype-extended
2023-10-01 14:47:26 +00:00
plover-plugin-dotool-output
2023-07-10 18:10:12 +00:00
]);
plover-src = pkgs.plover.src;
2022-07-06 18:25:34 +00:00
plover-dictionaries-english =
[
{
enabled = true;
2022-07-09 18:50:23 +00:00
path = "tmpdic.yaml";
}
{
enabled = true;
2022-07-09 19:12:39 +00:00
path = ../../extra/user.yaml;
2022-07-06 18:25:34 +00:00
}
{
enabled = true;
2023-07-12 06:26:00 +00:00
path = ../../extra/emily-modifiers.json;
}
{
enabled = true;
2023-07-12 06:26:00 +00:00
path = ../../extra/emily-symbols.json;
}
2022-07-06 18:25:34 +00:00
]
++ (map (module: {
enabled = true;
2023-06-13 05:46:23 +00:00
path = "${pkgs.plover-dict-didoesdigital}/dictionaries/${module}.json";
2022-07-06 18:25:34 +00:00
}) [
2022-07-09 11:57:25 +00:00
#Put this first
"fingerspelling"
# put these in alphabetical order
2022-07-06 18:25:34 +00:00
"abbreviations"
"briefs"
"currency"
"dict"
"nouns"
"numbers"
"numbers-powerups"
2022-07-07 10:50:56 +00:00
"plover-use"
2022-07-06 18:25:34 +00:00
"proper-nouns"
"top-level-domains"
# Put these last
"condensed-strokes"
]);
2022-06-12 15:39:15 +00:00
plover-cfg = pkgs.writeText "plover.cfg" (lib.generators.toINI {} {
2022-07-27 21:02:53 +00:00
"Machine Configuration".machine_type = "Plover HID";
2023-07-12 06:26:00 +00:00
"System: Stenotype Extended" = {
2022-06-18 08:57:25 +00:00
dictionaries = builtins.toJSON plover-dictionaries-english;
2023-07-12 06:26:00 +00:00
"keymap[plover hid]" = ''[["#", ["X3", "X4", "X5", "X6", "X7", "X8", "X43", "X44", "X45", "X46", "X47", "X48"]], ["^-", ["X24", "X37", "X38", "X77", "X78"]], ["+-", ["X16"]], ["S-", ["X15", "X23"]], ["T-", ["X14"]], ["K-", ["X22"]], ["P-", ["X13"]], ["W-", ["X21"]], ["H-", ["X12"]], ["R-", ["X20"]], ["A-", ["X36"]], ["O-", ["X35"]], ["*", ["X11", "X19", "X56", "X64"]], ["-E", ["X80"]], ["-U", ["X79"]], ["-F", ["X55"]], ["-R", ["X63"]], ["-P", ["X54"]], ["-B", ["X62"]], ["-L", ["X53"]], ["-G", ["X61"]], ["-T", ["X52"]], ["-S", ["X60"]], ["-D", ["X51"]], ["-Z", ["X59"]], ["no-op", ["X1", "X2", "X9", "X10", "X17", "X18", "X25", "X26", "X27", "X28", "X29", "X30", "X31", "X32", "X33", "X34", "X39", "X40", "X41", "X42", "X49", "X50", "X57", "X58", "X65", "X66", "X67", "X68", "X69", "X70", "X71", "X72", "X73", "X74", "X75", "X76"]]]'';
2022-06-18 08:57:25 +00:00
};
2022-10-07 07:06:19 +00:00
Plugins.enabled_extensions = builtins.toJSON ["RKB Unicode Sender" "plover_tapey_tape"];
2023-07-12 06:26:00 +00:00
System.name = "Stenotype Extended";
});
2022-06-12 15:39:15 +00:00
in {
2022-01-24 09:06:57 +00:00
home.packages = [
2022-06-18 08:23:53 +00:00
plover-env
2022-01-24 09:06:57 +00:00
];
2022-06-12 15:39:15 +00:00
home.activation.ploverSettings = lib.hm.dag.entryAfter ["writeBoundary"] ''
$DRY_RUN_CMD mkdir $VERBOSE_ARG -p $HOME/.config/plover
$DRY_RUN_CMD rm -f $HOME/.config/plover/plover.cfg
$DRY_RUN_CMD cp $VERBOSE_ARG ${plover-cfg} $HOME/.config/plover/plover.cfg
$DRY_RUN_CMD chmod +w $VERBOSE_ARG $HOME/.config/plover/plover.cfg
2022-06-01 16:59:56 +00:00
'';
2022-01-24 09:06:57 +00:00
}