This repository has no description
1.9 kB
54 lines
1{
2 python3,
3 fetchurl,
4 fetchFromGitHub,
5}:
6let
7 # Create a python environment with our overrides
8 python = python3.override {
9 self = python;
10 packageOverrides = final: prev: {
11 # Override kokoro with a more recent version and stdout support
12 kokoro = prev.kokoro.overridePythonAttrs (old: {
13 version = "0-unstable-2025-08-06";
14 src = fetchFromGitHub {
15 owner = "hexgrad";
16 repo = "kokoro";
17 rev = "dfb907a02bba8152ca444717ca5d78747ccb4bec";
18 hash = "sha256-GJlc3+RCeYaAvojFFjK22nitDTWFWp6dAPJakw+//j8=";
19 };
20 patches = (old.patches or [ ]) ++ [
21 ./stdout-support.patch
22 ];
23 });
24 # Spacy model - downloaded and packaged as a python package
25 spacy-en-core-web-sm = final.buildPythonPackage rec {
26 pname = "en_core_web_sm";
27 version = "3.8.0";
28 format = "wheel";
29
30 src = fetchurl {
31 url = "https://github.com/explosion/spacy-models/releases/download/${pname}-${version}/${pname}-${version}-py3-none-any.whl";
32 hash = "sha256-GTJCnbcn1L/z3u1rNM/AXfF3lPSlLusmz4ko98Gg+4U=";
33 };
34
35 propagatedBuildInputs = [ final.spacy ];
36
37 pythonImportsCheck = [ "en_core_web_sm" ];
38 };
39
40 # Create a patched misaki that doesn't try to download spacy models
41 misaki = prev.misaki.overridePythonAttrs (old: {
42 postPatch = (old.postPatch or "") + ''
43 # Patch out the spacy model download - we provide it as a dependency instead
44 substituteInPlace misaki/en.py \
45 --replace-fail "if not spacy.util.is_package(name):" "if False:" \
46 --replace-fail "spacy.cli.download(name)" "pass"
47 '';
48
49 propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ final.spacy-en-core-web-sm ];
50 });
51 };
52 };
53in
54python.pkgs.kokoro