|
11 | 11 | let |
12 | 12 | pkgs = import nixpkgs { |
13 | 13 | inherit system; |
14 | | - # Allow unfree packages to support the Business Source License 1.1 |
15 | | - config.allowUnfree = true; |
16 | 14 | }; |
17 | | - deepwork = pkgs.python311Packages.buildPythonPackage { |
18 | | - pname = "deepwork"; |
19 | | - version = "0.3.0"; |
| 15 | + |
| 16 | + # Create a wrapped Python environment with deepwork available |
| 17 | + pythonWithDeepwork = pkgs.python311.withPackages (ps: [ |
| 18 | + (ps.buildPythonPackage { |
| 19 | + pname = "deepwork"; |
| 20 | + version = "0.3.0"; |
| 21 | + src = ./.; |
| 22 | + format = "pyproject"; |
| 23 | + |
| 24 | + nativeBuildInputs = with ps; [ |
| 25 | + hatchling |
| 26 | + ]; |
| 27 | + |
| 28 | + propagatedBuildInputs = with ps; [ |
| 29 | + jinja2 |
| 30 | + pyyaml |
| 31 | + gitpython |
| 32 | + click |
| 33 | + rich |
| 34 | + jsonschema |
| 35 | + ]; |
| 36 | + |
| 37 | + # Skip tests during build (they can be run in devShell) |
| 38 | + doCheck = false; |
| 39 | + |
| 40 | + meta = with pkgs.lib; { |
| 41 | + description = "Framework for enabling AI agents to perform complex, multi-step work tasks"; |
| 42 | + homepage = "https://github.com/Unsupervisedcom/deepwork"; |
| 43 | + # Business Source License 1.1 - not OSI approved |
| 44 | + license = { |
| 45 | + fullName = "Business Source License 1.1"; |
| 46 | + url = "https://github.com/Unsupervisedcom/deepwork/blob/main/LICENSE.md"; |
| 47 | + free = false; |
| 48 | + }; |
| 49 | + }; |
| 50 | + }) |
| 51 | + ]); |
| 52 | + |
| 53 | + # Create the main deepwork package with proper wrappers |
| 54 | + deepwork = pkgs.stdenv.mkDerivation { |
| 55 | + name = "deepwork-0.3.0"; |
20 | 56 | src = ./.; |
21 | | - format = "pyproject"; |
22 | | - |
23 | | - nativeBuildInputs = with pkgs.python311Packages; [ |
24 | | - hatchling |
25 | | - ]; |
26 | | - |
27 | | - propagatedBuildInputs = with pkgs.python311Packages; [ |
28 | | - jinja2 |
29 | | - pyyaml |
30 | | - gitpython |
31 | | - click |
32 | | - rich |
33 | | - jsonschema |
34 | | - ]; |
35 | 57 |
|
36 | | - # Skip tests during build (they can be run in devShell) |
37 | | - doCheck = false; |
| 58 | + nativeBuildInputs = [ pkgs.makeWrapper ]; |
| 59 | + |
| 60 | + buildPhase = '' |
| 61 | + # Nothing to build, we just need to wrap the Python package |
| 62 | + ''; |
| 63 | + |
| 64 | + installPhase = '' |
| 65 | + mkdir -p $out/bin |
| 66 | +
|
| 67 | + # Create wrapper for deepwork CLI |
| 68 | + makeWrapper ${pythonWithDeepwork}/bin/deepwork $out/bin/deepwork \ |
| 69 | + --set PYTHONPATH "${pythonWithDeepwork}/${pythonWithDeepwork.sitePackages}" |
| 70 | +
|
| 71 | + # Create wrapper scripts for claude hook |
| 72 | + makeWrapper ${pythonWithDeepwork}/bin/python $out/bin/deepwork-claude-hook \ |
| 73 | + --add-flags "-m" \ |
| 74 | + --set PYTHONPATH "${pythonWithDeepwork}/${pythonWithDeepwork.sitePackages}" \ |
| 75 | + --set DEEPWORK_HOOK_PLATFORM "claude" |
| 76 | +
|
| 77 | + # Create wrapper scripts for gemini hook |
| 78 | + makeWrapper ${pythonWithDeepwork}/bin/python $out/bin/deepwork-gemini-hook \ |
| 79 | + --add-flags "-m" \ |
| 80 | + --set PYTHONPATH "${pythonWithDeepwork}/${pythonWithDeepwork.sitePackages}" \ |
| 81 | + --set DEEPWORK_HOOK_PLATFORM "gemini" |
| 82 | +
|
| 83 | + # Also create a python wrapper that has deepwork in PYTHONPATH |
| 84 | + makeWrapper ${pythonWithDeepwork}/bin/python $out/bin/deepwork-python \ |
| 85 | + --set PYTHONPATH "${pythonWithDeepwork}/${pythonWithDeepwork.sitePackages}" |
| 86 | + ''; |
38 | 87 |
|
39 | 88 | meta = with pkgs.lib; { |
40 | 89 | description = "Framework for enabling AI agents to perform complex, multi-step work tasks"; |
41 | 90 | homepage = "https://github.com/Unsupervisedcom/deepwork"; |
42 | | - # Business Source License 1.1 - not OSI approved |
43 | 91 | license = { |
44 | 92 | fullName = "Business Source License 1.1"; |
45 | 93 | url = "https://github.com/Unsupervisedcom/deepwork/blob/main/LICENSE.md"; |
|
0 commit comments