mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-12 06:19:00 +00:00
services/plover: update module descriptions and settings file generation
This commit is contained in:
parent
112e155aa4
commit
94f75728c4
@ -23,6 +23,7 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
settingsFormat = ploverIniFormat { };
|
settingsFormat = ploverIniFormat { };
|
||||||
|
settingsFile = settingsFormat.generate "plover-config-${config.home.username}" cfg.settings;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.services.plover = {
|
options.services.plover = {
|
||||||
@ -41,17 +42,15 @@ in
|
|||||||
description = "Configuration to be used for the application.";
|
description = "Configuration to be used for the application.";
|
||||||
default = { };
|
default = { };
|
||||||
defaultText = lib.literalExpression "{}";
|
defaultText = lib.literalExpression "{}";
|
||||||
example = lib.literalExpression ''
|
example = {
|
||||||
{
|
"Output Configuration" = {
|
||||||
"Output Configuration" = {
|
undo_levels = 100;
|
||||||
undo_levels = 100;
|
};
|
||||||
};
|
|
||||||
|
|
||||||
"Stroke Display" = {
|
"Stroke Display" = {
|
||||||
show = true;
|
show = true;
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extraOptions = lib.mkOption {
|
extraOptions = lib.mkOption {
|
||||||
@ -74,9 +73,7 @@ in
|
|||||||
|
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
xdg.configFile."plover/plover.cfg".source =
|
xdg.configFile."plover/plover.cfg".source = lib.mkIf (cfg.settings != { }) settingsFile;
|
||||||
settingsFormat.generate "plover-config-${config.home.username}"
|
|
||||||
cfg.settings;
|
|
||||||
|
|
||||||
systemd.user.services.plover = {
|
systemd.user.services.plover = {
|
||||||
Unit = {
|
Unit = {
|
||||||
@ -85,11 +82,7 @@ in
|
|||||||
PartOf = "default.target";
|
PartOf = "default.target";
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service.ExecStart = "${lib.getExe' cfg.package "plover"} ${lib.concatStringsSep " " cfg.extraOptions}";
|
||||||
ExecStart = "${cfg.package}/bin/plover ${
|
|
||||||
lib.concatStringsSep " " cfg.extraOptions
|
|
||||||
}";
|
|
||||||
};
|
|
||||||
|
|
||||||
Install.WantedBy = [ "default.target" ];
|
Install.WantedBy = [ "default.target" ];
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user