nix/espeakup.nix
2024-11-20 14:14:59 -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 = "";
};
};
};
}