Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shell.nix and package vosk #62

Closed
wants to merge 6 commits into from

Conversation

mankyKitty
Copy link

Greetings, started playing around with this the other day.. I run NixOS so I had to lay some groundwork first.. Thought others might appreciate it too.

It just drops you into a nix-shell with the required packages so you can run nerd-dictation. It packages a couple of the English models. Easy enough to copy for other language models though. :)

@ideasman42
Copy link
Owner

While having nix support seems OK (I didn't use nix yet), I'd rather this not scatter files about the projects root, suggest pacakge/nix similar to the existing package/python.

@jtojnar
Copy link

jtojnar commented Aug 5, 2022

I also created a PR packaging it for Nixpkgs: NixOS/nixpkgs#185148

@mankyKitty
Copy link
Author

Moved the files under package/nix.

@ideasman42
Copy link
Owner

ideasman42 commented Aug 6, 2022

  • Please include a readme.rst that includes steps to install with nix, e.g: https://github.com/ideasman42/nerd-dictation/tree/master/package/python
  • If nerd-dictation: init at unstable-2022-07-12 NixOS/nixpkgs#185148 is accepted, what is the purpose of this nix package? (should be noted in the readme.rst).
  • Add default.nix, but terrible is one commit, include a detailed comment explaining how and why it is terrible and should be improved.
  • There are version numbers for nerd-dictation in the nix file 20220605 for e.g. Why is this needed? Shouldn't it use the current GIT version?
  • Some packages listed I'm not aware of (tqdm, srt, websockets), add comments explaining why they are needed (what breaks if they're removed).

@mankyKitty
Copy link
Author

Added, I didn't copy over all of the documentation on the usage of nerd-dictation as it didn't seem like a good idea to create yet another copy that may end up out of sync.

If that is accepted then this PR can probably be closed without merging. I created this because this Python was unusable on my machine without it and I thought other Nix users might appreciate the short-cut. @jtojnar Your thoughts?

Additionally vosk was not in mainline nixpkgs and given that I don't write Python it seemed inappropriate for me to upstream it.

  • Add default.nix, but terrible is one commit, include a detailed comment explaining how and why it is terrible and should be improved.

Haha, that's what I get for writing commit messages whilst grumpy at Python. The default.nix is far from terrible now.

  • There are version numbers for nerd-dictation in the nix file 20220605 for e.g. Why is this needed? Shouldn't it use the current GIT version?

All nix packages require a version identifier, I used the latest date from the changelog.rst. This package will use the latest version of whatever the user has due to this line : https://github.com/ideasman42/nerd-dictation/pull/62/files#diff-919f5826527178d5661c7d9ecfed039426feb7131c0e36e747f3e796a15ca515R12 :)

  • Some packages listed I'm not aware of (tqdm, srt, websockets), add comments explaining why they are needed (what breaks if they're removed).

Ahh, they are dependencies of vosk and are remnants of me hacking on this at the beginning. I'll remove them from the default.nix.

Sean Chalmers added 2 commits August 6, 2022 13:27
@jtojnar
Copy link

jtojnar commented Aug 6, 2022

If that is accepted then this PR can probably be closed without merging. I created this because this Python was unusable on my machine without it and I thought other Nix users might appreciate the short-cut. @jtojnar Your thoughts?

Having it in Nixpkgs is probably better since vosk depends on a custom version of kaldi and it would be useful to make use of Hydra binary cache (kaldi takes ages to build).

But I am no longer interested in maintaining the package since unfortunately, nerd-dictation appears to be too rough to use at the moment (the text entry does not appear to be aware of previously added text, would probably need to be combined with some input method like https://github.com/PhilippeRo/IBus-Speech-To-Text does).

Also there is some Python weirdness in setup.py: NixOS/nixpkgs#185148 (comment)

If you are interested in it, feel free to take over the pull request.

@mankyKitty mankyKitty closed this Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants