54 lines
1 KiB
Nix
54 lines
1 KiB
Nix
{ 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 {
|
|
|
|
options.programs.custom.espeak.enable =
|
|
mkEnableOption "enable espeak scripts";
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
espeak
|
|
en_espeak
|
|
en_read
|
|
de_espeak
|
|
de_read
|
|
];
|
|
|
|
};
|
|
}
|
|
|