Skip to content

Commit ebdac09

Browse files
committed
docs: update caching section in readme
[skip ci]
1 parent f5c94a3 commit ebdac09

1 file changed

Lines changed: 34 additions & 4 deletions

File tree

README.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,44 @@ This project supports the following Python versions:
99
- 2.7.6+
1010
- 3.3.1+ (up to the latest release)
1111

12-
## Cachix (optional)
12+
## Caching (optional)
1313

14-
If you'd like to avoid compilation [install Cachix](https://docs.cachix.org/installation) and:
14+
Use the [Cachix](https://docs.cachix.org/installation) binary cache to avoid rebuilding Python from source.
15+
16+
#### System-wide
17+
18+
[Install Cachix](https://docs.cachix.org/installation) and run:
1519

1620
$ cachix use nixpkgs-python
1721

18-
Using the following platforms:
22+
#### devenv
23+
24+
Add to your `devenv.nix`:
25+
26+
```nix
27+
cachix.pull = [ "nixpkgs-python" ];
28+
```
29+
30+
#### Flake
31+
32+
Add the cache substituter and public key to your `flake.nix`:
33+
34+
```nix
35+
{
36+
nixConfig = {
37+
extra-substituters = "https://nixpkgs-python.cachix.org";
38+
extra-trusted-public-keys = "nixpkgs-python.cachix.org-1:hxjI7pFxTyuTHn2NkvWCrAUcber0jBIYSMemRlUcXNk=";
39+
};
40+
}
41+
```
42+
43+
> [!NOTE]
44+
> Do not override the `nixpkgs` input when using this flake.
45+
> The cached builds are tied to the pinned nixpkgs revision; overriding it will result in cache misses and local rebuilds.
46+
47+
To push your own builds to the cache (useful in CI or team setups), [create a Cachix account](https://app.cachix.org/) and configure a push workflow so builds are cached as they happen.
48+
49+
Supported platforms:
1950

2051
- x86_64-darwin
2152
- x86_64-linux
@@ -49,7 +80,6 @@ inputs:
4980
Then run:
5081
5182
$ devenv shell
52-
...
5383
5484
### flake.nix
5585

0 commit comments

Comments
 (0)