Skip to content

Commit 4ebafa6

Browse files
committed
Added optional espeak dependency.
To configure espeak for TTS, pass withSpeech = true to the package call.
1 parent 2904820 commit 4ebafa6

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ On windows via [Scoop](https://scoop.sh/):
6060
scoop install mob
6161
```
6262

63-
On [Nix](http://nixos.org) through the [mob.nix](./mob.nix) expression like this `mob = callPackage ./mob.nix {};`.
63+
On [Nix](http://nixos.org) through the [mob.nix](./mob.nix) expression like this `mob = callPackage ./mob.nix {};`. To install and configure espeak-ng for text-to-spech support, pass `withSpeech = true;`.
6464

6565
## How to use
6666

mob.nix

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{buildGoPackage, fetchFromGitHub, lib, ...}:
1+
{withSpeech ? false, makeWrapper, espeak-ng, buildGoPackage, fetchFromGitHub, lib, ...}:
22
buildGoPackage rec {
33
pname = "mob.sh";
44
version = "1.3.0";
@@ -11,6 +11,12 @@ buildGoPackage rec {
1111
sha256 = "04x6cl2r4ja41cmy82p5apyavmdvak6jsclzf2l7islf0pmsnddv";
1212
};
1313

14+
buildInputs =
15+
if withSpeech then
16+
[ espeak-ng makeWrapper ]
17+
else
18+
[];
19+
1420
goPackagePath = "github.com/${owner}/${repo}/";
1521

1622
subPackages = [ "." ];
@@ -20,4 +26,9 @@ buildGoPackage rec {
2026
homepage = "https://mob.sh";
2127
license = lib.licenses.mit;
2228
};
29+
30+
preFixup = if withSpeech then ''
31+
wrapProgram "$out/bin/mob" --set MOB_VOICE_COMMAND "${espeak-ng.out}/bin/espeak"
32+
'' else "";
33+
2334
}

0 commit comments

Comments
 (0)