And then nixpkg.overlay in my configuration.nix
But it says the hash is incorrect. Might be true. I do not know how to do this. I just want to use python and its available libraries but I am going down a rabbit hole. Maybe I can try NOT using wheels and use the compilation from source(?. But still. I do not know if I am putting the right hash. I am just using nix-prefetch-url (url provided in vosk homepage) to get the hash.
Don’t waste time with prefetch scripts.
Just set the hash to "" (exactly the empty string, do not use anything else) and build and use the “expected” hash from the error.
Ok. So I read the manual again and walked through the process. I will be using a nix-shell for easier testing. The only thing I’m missing is the (hash). How do I get that? Am I getting the right one?
If I leave it empty it says ERROR 404.
shell.nix
maximo@nixos:~/1.dev/python/toolz/ > cat shell.nix
with import <nixpkgs> { };
(
let
my_vosk = python313.pkgs.buildPythonPackage rec {
pname = "vosk";
version = "0.3.45";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-25e025093c4399d7278f543568ed8cc5460ac3a4bf48c23673ace1e25d26619f";
};
build-system = [ python313.pkgs.setuptools ];
# has no tests
doCheck = false;
meta = {
homepage = "https://github.com/pytoolz/toolz/";
description = "List processing tools and functional utilities";
# [...]
};
};
in
python313.withPackages (
ps: with ps; [
numpy
my_vosk
]
)
).env
Excuse the softness of my brain but I do not understand anything in that pull request. I just want to add a python package in nixos. Thank you of course for the reply.
That means the file is not available, then. Setting a hash won’t help you, you have to fetch a file that exists. The pull request I linked uses fetchFromGitHub instead.