Skip to content

Commit 0b06dd1

Browse files
committed
docs(installation): update Nix flake guide to use overlay pattern
The CLI now exports overlays.default, enabling users to integrate probitas into their pkgs namespace rather than referencing it via packages.${system}. This provides cleaner configuration with 'with pkgs;' syntax and ensures consistent Deno versions by using the user's nixpkgs automatically. Added "Why Use Overlays?" section explaining the benefits of unified namespace, composability, and automatic Deno version consistency. Updated Flake Outputs Reference table to include overlays.default.
1 parent fc1d1ed commit 0b06dd1

1 file changed

Lines changed: 32 additions & 12 deletions

File tree

docs/installation.md

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ nix profile install github:jsr-probitas/cli
6363

6464
### Add to Project's flake.nix
6565

66-
Add Probitas to your project's development environment. Create or update
67-
`flake.nix`:
66+
Add Probitas to your project's development environment using the overlay:
6867

6968
```nix
7069
{
@@ -79,12 +78,15 @@ Add Probitas to your project's development environment. Create or update
7978
outputs = { self, nixpkgs, flake-utils, probitas }:
8079
flake-utils.lib.eachDefaultSystem (system:
8180
let
82-
pkgs = import nixpkgs { inherit system; };
81+
pkgs = import nixpkgs {
82+
inherit system;
83+
overlays = [ probitas.overlays.default ];
84+
};
8385
in {
8486
devShells.default = pkgs.mkShell {
85-
packages = [
86-
pkgs.deno
87-
probitas.packages.${system}.default
87+
packages = with pkgs; [
88+
deno
89+
probitas
8890
];
8991
};
9092
});
@@ -97,6 +99,23 @@ Enter the development environment:
9799
nix develop
98100
```
99101

102+
### Why Use Overlays?
103+
104+
The overlay pattern integrates `probitas` directly into your `pkgs`, enabling
105+
cleaner configuration:
106+
107+
```nix
108+
overlays = [ probitas.overlays.default ];
109+
# ...
110+
packages = with pkgs; [ deno probitas ]; # probitas is now part of pkgs
111+
```
112+
113+
Benefits:
114+
115+
- **Unified namespace**: Access `probitas` like any nixpkgs package
116+
- **Composable**: Combine with other overlays seamlessly
117+
- **Consistent Deno**: Uses your project's nixpkgs Deno version automatically
118+
100119
### Why Use inputs.follows?
101120

102121
The `inputs.follows` directive ensures Probitas uses your project's nixpkgs
@@ -132,12 +151,13 @@ probitas.url = "github:jsr-probitas/cli/abc1234";
132151

133152
The Probitas CLI flake provides:
134153

135-
| Output | Description |
136-
| ----------------------------- | --------------------------- |
137-
| `packages.${system}.default` | The `probitas` CLI package |
138-
| `packages.${system}.probitas` | Alias for the CLI package |
139-
| `apps.${system}.default` | App for `nix run` |
140-
| `devShells.${system}.default` | Development shell with Deno |
154+
| Output | Description |
155+
| ----------------------------- | --------------------------------- |
156+
| `overlays.default` | Overlay adding `probitas` to pkgs |
157+
| `packages.${system}.default` | The `probitas` CLI package |
158+
| `packages.${system}.probitas` | Alias for the CLI package |
159+
| `apps.${system}.default` | App for `nix run` |
160+
| `devShells.${system}.default` | Development shell with Deno |
141161

142162
## Verify Installation
143163

0 commit comments

Comments
 (0)