2022-04-13 09:45:39 +00:00
|
|
|
{ lib, pkgs, ... }:
|
2022-03-04 19:20:54 +00:00
|
|
|
let
|
|
|
|
plover-src = pkgs.plover.dev.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";
|
|
|
|
"SER/WAL" = "serval";
|
|
|
|
});
|
|
|
|
}
|
|
|
|
{
|
|
|
|
enabled = true;
|
|
|
|
path = "${plover-src}/plover/assets/commands.json";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
enabled = true;
|
|
|
|
path = "${plover-src}/plover/assets/main.json";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
plover-cfg = pkgs.writeText "plover.cfg" (lib.generators.toINI { } {
|
|
|
|
"Machine Configuration".machine_type = "Keyboard";
|
|
|
|
"System: English Stenotype" = {
|
|
|
|
dictionaries = builtins.toJSON plover-dictionaries;
|
|
|
|
};
|
|
|
|
});
|
2022-03-04 19:20:54 +00:00
|
|
|
in
|
|
|
|
{
|
2022-01-24 09:06:57 +00:00
|
|
|
home.packages = [
|
|
|
|
pkgs.plover.dev
|
|
|
|
];
|
2022-04-13 09:45:39 +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-03-06 09:55:53 +00:00
|
|
|
systemd.user.services.plover = {
|
|
|
|
Unit = {
|
|
|
|
Description = "plover";
|
|
|
|
After = [ "tray.target" ];
|
|
|
|
PartOf = [ "graphical-session.target" ];
|
|
|
|
Requires = [ "tray.target" ];
|
|
|
|
};
|
|
|
|
Install = {
|
|
|
|
WantedBy = [ "graphical-session.target" ];
|
|
|
|
};
|
|
|
|
Service = {
|
|
|
|
ExecStart = "${pkgs.plover.dev}/bin/plover";
|
2022-03-04 19:20:54 +00:00
|
|
|
};
|
|
|
|
};
|
2022-01-24 09:06:57 +00:00
|
|
|
}
|