-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
79 lines (76 loc) · 2.62 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{
description = "srvc-hello";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.05";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
pypi-deps-db = {
url = "github:DavHau/pypi-deps-db";
inputs.nixpkgs.follows = "nixpkgs";
inputs.mach-nix.follows = "mach-nix";
};
mach-nix = {
url = "github:DavHau/mach-nix/3.5.0";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
inputs.pypi-deps-db.follows = "pypi-deps-db";
};
srvc.url = "github:insilica/rs-srvc/v0.13.0";
};
outputs = { self, nixpkgs, flake-utils, mach-nix, srvc, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system:
with import nixpkgs { inherit system; };
let
mach = import mach-nix {
inherit pkgs;
pypiDataRev = "e9571cac25d2f509e44fec9dc94a3703a40126ff";
pypiDataSha256 =
"sha256:1rbb0yx5kjn0j6lk0ml163227swji8abvq0krynqyi759ixirxd5";
};
reqs = builtins.readFile ./requirements.txt;
spacy-en-core-web-sm = mach.buildPythonPackage rec {
pname = "en_core_web_sm";
version = "3.4.0";
src = fetchTarball {
url =
"https://github.com/explosion/spacy-models/releases/download/${pname}-${version}/${pname}-${version}.tar.gz";
sha256 =
"sha256:0fq0ijja5p0qklh0c4z527kgck0ipsyhqvpicah7ii20666wn7vm";
};
requirements = reqs;
};
spacy-en-core-web-lg = mach.buildPythonPackage rec {
pname = "en_core_web_lg";
version = "3.4.0";
src = fetchTarball {
url =
"https://github.com/explosion/spacy-models/releases/download/${pname}-${version}/${pname}-${version}.tar.gz";
sha256 =
"sha256:19b114g1m52kpvrlz1m6ywd6hghbq0wxb6lny9q83b44rx5499nh";
};
requirements = reqs;
};
spacy-python = mach.mkPython {
requirements = reqs;
packagesExtra = [ spacy-en-core-web-sm spacy-en-core-web-lg ];
};
spacy = stdenv.mkDerivation {
pname = "spacy";
version = "0.1.0";
src = ./src;
buildInputs = [ spacy-python ];
installPhase = ''
mkdir -p $out/bin
cp spacy-ner.py $out/bin/spacy
'';
};
in {
packages = { inherit spacy spacy-python; };
devShells.default = mkShell {
buildInputs = [ spacy-python srvc.packages.${system}.default ];
};
});
}