nixos-config/modules/programs/espeak.nix

55 lines
1 KiB
Nix
Raw Normal View History

2019-10-24 02:20:38 +02:00
{ config, pkgs, lib, ... }:
with lib;
let
# can't use bash aliases because programms will not pic it up
en_espeak = pkgs.writeShellScriptBin "en-speak" ''
exec ${pkgs.espeak}/bin/espeak \
-v en\
-s 145 \
-p 23 \
$@
'';
# read from copyq
en_read = pkgs.writeShellScriptBin "en-read" ''
exec ${pkgs.copyq}/bin/copyq read 0 | ${en_espeak}/bin/en-speak
'';
# can't use bash aliases because programms will not pic it up
de_espeak = pkgs.writeShellScriptBin "de-speak" ''
exec ${pkgs.espeak}/bin/espeak \
-v de\
-s 143 \
-p 20 \
$@
'';
# read from copyq
de_read = pkgs.writeShellScriptBin "de-read" ''
exec ${pkgs.copyq}/bin/copyq read 0 | ${de_espeak}/bin/de-speak
'';
cfg = config.programs.custom.espeak;
in {
2019-12-20 05:54:26 +01:00
options.programs.custom.espeak.enable =
mkEnableOption "enable espeak scripts";
2019-10-24 02:20:38 +02:00
config = mkIf cfg.enable {
2019-12-20 05:54:26 +01:00
environment.systemPackages = with pkgs; [
2019-10-24 02:20:38 +02:00
espeak
en_espeak
en_read
de_espeak
de_read
];
};
}