nixos/espeakup.nix
2024-12-18 18:19:37 -06:00

42 lines
785 B
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.espeakup;
inherit (lib)
mkEnableOption
mkIf
mkPackageOption
mkOption
types
;
in
{
options.services.espeakup = {
enable = mkEnableOption "Espeakup screen reader";
package = mkPackageOption pkgs "espeakup" { };
defaultVoice = mkOption {
type = types.str;
default = "en-gb";
description = "Default voice for espeakup";
};
};
config = mkIf cfg.enable {
boot.kernelModules = [ "speakup_soft" ];
systemd.packages = [ pkgs.espeakup ];
systemd.services.espeakup = {
wantedBy = [ "sound.target" ];
environment = {
default_voice = cfg.defaultVoice;
};
serviceConfig = {
ExecStartPre = "";
};
};
};
}