Skip to content

Commit 689bfcc

Browse files
committed
readme
1 parent e2c0251 commit 689bfcc

File tree

1 file changed

+63
-25
lines changed

1 file changed

+63
-25
lines changed

README.md

Lines changed: 63 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,24 @@
11
# wooper.dev
22

3-
Use any version of any nixpkgs package without writing a flake.
3+
A web service that generates Nix flakes with specific package versions from nixpkgs history. Use any version of any nixpkgs package without writing a flake.
44

5-
## Usage
5+
## Prerequisites
6+
7+
- [Nix](https://nixos.org/download/) with flakes enabled
8+
9+
## Quick Start
610

711
```bash
8-
# Enter a shell with specific package versions
12+
# Enter a shell with specific packages
913
nix shell "https://wooper.dev/python3;nodejs;ruff"
1014

1115
# Run a package directly
1216
nix run "https://wooper.dev/uv~=0.5.0#uv" -- --version
1317
```
1418

15-
The first run takes a while as Nix downloads and evaluates the flake.
16-
17-
### Portable shell scripts
19+
The first run takes a while as Nix downloads and evaluates the flake. Subsequent runs use the cache.
1820

19-
Generate a standalone shell script that can be committed to your repo:
20-
21-
```bash
22-
nix run "https://wooper.dev/uv~=0.5.0;ruff" > dev.sh
23-
chmod +x dev.sh
24-
```
25-
26-
The script fetches packages directly from cache.nixos.org without re-evaluating the flake. Anyone with Nix can run it instantly.
27-
28-
Works on aarch64-darwin, x86_64-darwin, aarch64-linux, and x86_64-linux.
29-
30-
### Version specifiers
21+
## Version Specifiers
3122

3223
Wooper uses [PEP 440](https://peps.python.org/pep-0440/) version specifiers:
3324

@@ -38,19 +29,38 @@ Wooper uses [PEP 440](https://peps.python.org/pep-0440/) version specifiers:
3829
| `uv>=0.5.0` | Minimum version |
3930
| `uv~=0.5.0` | Compatible release (>=0.5.0, <0.6.0) |
4031

41-
### Multiple packages
32+
**Note:** `>` and `<` must be URL-encoded (`%3E`, `%3C`) as they break Nix's URL parser.
33+
34+
## Multiple Packages
4235

4336
Separate packages with semicolons:
4437

4538
```bash
4639
nix shell "https://wooper.dev/python3~=3.12;uv~=0.5.0;ruff"
4740
```
4841

49-
Note: `>` and `<` must be URL-encoded (`%3E`, `%3C`) as they break Nix's URL parser.
42+
Wooper optimizes flake inputs by selecting the minimum number of nixpkgs revisions needed to satisfy all version requirements.
43+
44+
**Limits:**
45+
- Maximum 50 packages per request
46+
- Ambiguous packages like `python` are rejected—use `python2` or `python3`
47+
48+
## Portable Shell Scripts
5049

51-
### Use in a flake
50+
Generate a standalone shell script that can be committed to your repo:
5251

53-
Use wooper.dev as a flake input to pin specific package versions:
52+
```bash
53+
nix run "https://wooper.dev/uv~=0.5.0;ruff" > dev.sh
54+
chmod +x dev.sh
55+
```
56+
57+
When run, the generated flake outputs a shell script to stdout (via [quickshell](https://github.com/buurro/quickshell)). This script fetches packages directly from cache.nixos.org without re-evaluating the flake—anyone with Nix can run it instantly.
58+
59+
Works on aarch64-darwin, x86_64-darwin, aarch64-linux, and x86_64-linux.
60+
61+
## Use as a Flake Input
62+
63+
Pin specific package versions in your flake:
5464

5565
```nix
5666
{
@@ -75,19 +85,47 @@ Use wooper.dev as a flake input to pin specific package versions:
7585

7686
## API
7787

78-
See [wooper.dev/docs](https://wooper.dev/docs) for all endpoints.
88+
Interactive documentation available at [wooper.dev/docs](https://wooper.dev/docs).
89+
90+
### Endpoints
91+
92+
| Endpoint | Description |
93+
|----------|-------------|
94+
| `GET /{packages}` | Flake tarball (flake.nix + flake.lock) for `nix shell`/`nix run` |
95+
| `GET /flake/{packages}` | Raw flake.nix content |
96+
97+
### Example
98+
99+
```bash
100+
# Get flake.nix content
101+
curl "https://wooper.dev/flake/python3~=3.12"
102+
```
79103

80104
## Development
81105

106+
### Setup
107+
82108
```bash
109+
# Set up database connection
83110
export WOOPER_DB="postgresql://user:password@host/database"
84111

85-
# Fill the packages database (use a recent date)
112+
# Fill the packages database (use a recent date to limit initial sync)
86113
uv run -m wooper_dev.updater --after 2025-01-01
87114

88115
# Start dev server
89116
uv run uvicorn wooper_dev.main:app --reload
117+
```
118+
119+
The updater scrapes [Hydra](https://hydra.nixos.org/) for successful nixpkgs builds and indexes all package versions for each revision.
120+
121+
### Testing
90122

91-
# Update quickshell dependency
123+
```bash
124+
uv run pytest
125+
```
126+
127+
### Update quickshell dependency
128+
129+
```bash
92130
uv run scripts/update_quickshell.py
93131
```

0 commit comments

Comments
 (0)