Skip to content

Instantly share code, notes, and snippets.

@exarkun
Created January 4, 2019 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save exarkun/e3f94efdf727ae30f2e3899924b42526 to your computer and use it in GitHub Desktop.
Save exarkun/e3f94efdf727ae30f2e3899924b42526 to your computer and use it in GitHub Desktop.
{ fetchFromGitHub, buildPythonApplication, gettext, APScheduler, mock,
pytz, pyyaml, requests, blessings, pyaudio, pyalsaaudio, python-slugify,
cmuclmtk, semantic, facebook-sdk, feedparser, python-dateutil, python-mpd,
python-pymad, pkgs, python-pocketsphinx, phonetisaurus, phonetisaurus-model,
writeTextFile
}:
buildPythonApplication
rec {
name = "naomi";
version = "2018-12-26";
src = fetchFromGitHub {
owner = "NaomiProject";
repo = "Naomi";
rev = "dd6135f794d6bc7521eaba38a1562e5bb6ef75b1";
sha256 = "08lpjpqhpx1x5d46gzqxlym0a02g47l52kmfc8p25h3zscq7hmh5";
};
buildInputs =
[
gettext
];
propagatedBuildInputs =
[
APScheduler mock pytz pyyaml requests blessings pyaudio
pyalsaaudio python-slugify cmuclmtk semantic facebook-sdk feedparser
python-dateutil python-mpd python-pymad
# Our preferred configuration depends on these.
phonetisaurus python-pocketsphinx
];
patches = [ ./remove-argparse.patch ];
doCheck = false;
postBuild = ''
${pkgs.buildPackages.bash}/bin/bash ./compile_translations.sh
'';
naomi-config = writeTextFile
{
name = "naomi-config";
destination = "/profile.yml";
text = ''
active_stt:
engine: sphinx
reply: ""
response: ""
audio:
input_device: "null"
output_device: "null"
output_padding: false
audio_engine: alsa
email:
address: ""
imap: ""
first_name: Jean-Paul
keyword: Naomi
language: en-US
last_name: Calderone
output_chunksize: 1024
phone_number: ""
pocketsphinx:
fst_model: ${phonetisaurus-model}/share/train/model.fst
hmm_dir: hmm
phonetisaurus_executable: phonetisaurus-g2p
prefers_email: false
timezone: US/Eastern
tts_engine: espeak-tts
'';
};
postInstall = ''
set -x
sed -e 's/naomi.main/naomi.__main__/' -i "$out"/bin/Naomi
mkdir -p "$out"/etc/naomi
ln -s ${naomi-config}/profile.yml "$out"/etc/naomi/profile.yml
set +x
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment