2022-06-12 15:39:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
pkgs,
|
2022-06-16 20:47:46 +00:00
|
|
|
system,
|
2022-06-12 15:39:15 +00:00
|
|
|
...
|
|
|
|
}: let
|
2022-06-17 06:04:35 +00:00
|
|
|
inherit (pkgs) plover plover-plugins-manager;
|
2022-06-16 20:47:46 +00:00
|
|
|
plover-src = plover.src;
|
2022-04-13 09:45:39 +00:00
|
|
|
plover-dictionaries = [
|
|
|
|
{
|
|
|
|
enabled = true;
|
|
|
|
path = pkgs.writeText "user.json" (builtins.toJSON {
|
|
|
|
"SER/TKPWAL" = "Sergal";
|
|
|
|
"SERLG" = "Sergal";
|
2022-06-16 15:28:41 +00:00
|
|
|
"SER/SRAL" = "serval";
|
2022-04-13 09:45:39 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
{
|
|
|
|
enabled = true;
|
|
|
|
path = "${plover-src}/plover/assets/commands.json";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
enabled = true;
|
|
|
|
path = "${plover-src}/plover/assets/main.json";
|
|
|
|
}
|
|
|
|
];
|
2022-05-29 19:29:27 +00:00
|
|
|
keyboard-keymap = [
|
2022-06-12 15:39:15 +00:00
|
|
|
["#" ["1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "-" "=" "b"]]
|
|
|
|
["S-" ["q" "a"]]
|
|
|
|
["T-" ["w"]]
|
|
|
|
["K-" ["s"]]
|
|
|
|
["P-" ["e"]]
|
|
|
|
["W-" ["d"]]
|
|
|
|
["H-" ["r"]]
|
|
|
|
["R-" ["f"]]
|
|
|
|
["A-" ["c"]]
|
|
|
|
["O-" ["v"]]
|
|
|
|
["*" ["t" "y" "g" "h"]]
|
|
|
|
["-E" ["n"]]
|
|
|
|
["-U" ["m"]]
|
|
|
|
["-F" ["u"]]
|
|
|
|
["-R" ["j"]]
|
|
|
|
["-P" ["i"]]
|
|
|
|
["-B" ["k"]]
|
|
|
|
["-L" ["o"]]
|
|
|
|
["-G" ["l"]]
|
|
|
|
["-T" ["p"]]
|
|
|
|
["-S" [";"]]
|
|
|
|
["-D" ["["]]
|
|
|
|
["-Z" ["'"]]
|
|
|
|
["arpeggiate" ["space"]]
|
|
|
|
["no-op" ["\\" "]" "z" "x" "" "." "/"]]
|
2022-05-29 19:29:27 +00:00
|
|
|
];
|
2022-06-12 15:39:15 +00:00
|
|
|
plover-cfg = pkgs.writeText "plover.cfg" (lib.generators.toINI {} {
|
2022-04-13 09:45:39 +00:00
|
|
|
"Machine Configuration".machine_type = "Keyboard";
|
|
|
|
"System: English Stenotype" = {
|
|
|
|
dictionaries = builtins.toJSON plover-dictionaries;
|
2022-05-29 19:29:27 +00:00
|
|
|
"keymap[keyboard]" = builtins.toJSON keyboard-keymap;
|
2022-04-13 09:45:39 +00:00
|
|
|
};
|
|
|
|
});
|
2022-06-12 15:39:15 +00:00
|
|
|
in {
|
2022-01-24 09:06:57 +00:00
|
|
|
home.packages = [
|
2022-06-16 20:47:46 +00:00
|
|
|
plover
|
|
|
|
plover-plugins-manager
|
2022-01-24 09:06:57 +00:00
|
|
|
];
|
2022-06-12 15:39:15 +00:00
|
|
|
home.activation.ploverSettings = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
2022-04-13 09:45:39 +00:00
|
|
|
$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-03-06 09:55:53 +00:00
|
|
|
systemd.user.services.plover = {
|
|
|
|
Unit = {
|
|
|
|
Description = "plover";
|
2022-06-12 15:39:15 +00:00
|
|
|
After = ["tray.target"];
|
|
|
|
PartOf = ["graphical-session.target"];
|
|
|
|
Requires = ["tray.target"];
|
2022-03-06 09:55:53 +00:00
|
|
|
};
|
|
|
|
Install = {
|
2022-06-12 15:39:15 +00:00
|
|
|
WantedBy = ["graphical-session.target"];
|
2022-03-06 09:55:53 +00:00
|
|
|
};
|
|
|
|
Service = {
|
2022-06-16 20:47:46 +00:00
|
|
|
ExecStart = "${plover}/bin/plover";
|
2022-03-04 19:20:54 +00:00
|
|
|
};
|
|
|
|
};
|
2022-01-24 09:06:57 +00:00
|
|
|
}
|