Skip to content

Commit 1df1871

Browse files
Copilotncrmro
andauthored
feat: add nix flake for devshell and publication of deepwork package
* Initial plan * Add Nix flake, .envrc, and update documentation Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Enhance flake with apps output and improve README Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Add comprehensive Nix flake documentation Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Fix license definition and improve uv sync logic in flake Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Add missing jsonschema to development environment Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Enhance documentation with explicit GitHub flake reference examples Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Update validate workflow to use Nix development shell Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Add build job to validate flake package can be built Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Simplify Nix configuration in validate workflow Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Consolidate build into tests job after pytest Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * chore: * chore: allow unfree packages in nixpkgs for BSL 1.1 license * Fix Nix flake package to include Python with deepwork in PYTHONPATH Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Add deepwork hook CLI command for cleaner hook invocation Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Replace shell.nix with flake-compat wrapper Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Changes before error encountered Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Remove shell.nix and all references to nix-shell Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Remove final nix-shell reference from README Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Add rpds-py dependency to fix ModuleNotFoundError Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Document custom hooks and Python invocation with Nix flake Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Fix Python formatting with ruff Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Fix ruff linting issues: organize imports and fix exception handling Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Fix hook CLI to support custom module paths and remove invalid console.print parameter Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * Remove trailing whitespace in hook.py Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> * docs: explain auto-unfree license config in nix-flake.md * docs: add dev env info to AGENTS.md * docs: update nix-flake.md with recommended project configuration example --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com> Co-authored-by: Nicholas Romero <ncrmro@gmail.com>
1 parent 606ffaf commit 1df1871

17 files changed

Lines changed: 988 additions & 182 deletions

File tree

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.github/workflows/validate.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,27 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v4
2020

21-
- name: Install uv
22-
uses: astral-sh/setup-uv@v4
23-
with:
24-
version: "latest"
21+
- name: Install Nix
22+
uses: cachix/install-nix-action@v31
2523

26-
- name: Set up Python
27-
uses: actions/setup-python@v5
28-
with:
29-
python-version: "3.11"
24+
- name: Setup Nix development environment
25+
uses: nicknovitski/nix-develop@v1
3026

31-
- name: Install dependencies
27+
- name: Install Python dependencies
3228
run: uv sync --extra dev
3329

3430
- name: Check formatting (ruff)
3531
run: |
36-
uv run ruff format --check src/ tests/
37-
uv run ruff check src/ tests/
32+
ruff format --check src/ tests/
33+
ruff check src/ tests/
3834
3935
- name: Run tests
40-
run: uv run pytest tests/ -v
36+
run: pytest tests/ -v
37+
38+
- name: Build deepwork package
39+
run: nix build
40+
41+
- name: Verify package output
42+
run: |
43+
ls -la result/bin/deepwork
44+
./result/bin/deepwork --version

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ dmypy.json
6666
*~
6767
.DS_Store
6868

69+
# direnv
70+
.direnv/
71+
6972
# Jupyter Notebook
7073
.ipynb_checkpoints
7174

AGENTS.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,22 @@ deepwork/
8383
├── deepwork_jobs/ # ← Installed copy, NOT source of truth
8484
├── deepwork_rules/ # ← Installed copy, NOT source of truth
8585
└── [bespoke_job]/ # ← Source of truth for bespoke only
86+
87+
## Development Environment
88+
89+
This project uses **Nix Flakes** to provide a reproducible development environment.
90+
91+
### Using the Environment
92+
93+
- **With direnv (Recommended)**: Just `cd` into the directory. The `.envrc` will automatically load the flake environment.
94+
- **Without direnv**: Run `nix develop` to enter the shell.
95+
- **Building**: Run `nix build` to build the package.
96+
97+
**Note**: The flake is configured to automatically allow unfree packages (required for the BSL 1.1 license), so you do not need to set `NIXPKGS_ALLOW_UNFREE=1`.
98+
99+
The environment includes:
100+
- Python 3.11
101+
- uv (package manager)
102+
- All dev dependencies (pytest, ruff, mypy, etc.)
103+
86104
```

0 commit comments

Comments
 (0)