nix-playgraound/notes/044-non-flake-inputs.md
2026-05-04 11:29:17 +02:00

57 lines
1.4 KiB
Markdown

# Non-flake Inputs
This note covers `41-non-flake-inputs/`, which declares `inputs.releaseData.flake = false;` so the input is consumed as raw source instead of as a flake.
---
## 1. What `flake = false` Changes
Normally, a flake input is expected to expose `outputs`. Setting `flake = false` tells Nix to treat the input as a plain source tree instead.
The example reads that source through `self.inputs.releaseData`, so it works with files directly instead of importing another flake interface.
---
## 2. Why This Example Uses a Local Path
The example keeps the source local with:
```nix
releaseData = {
url = "path:./release-data";
flake = false;
};
```
That makes the boundary obvious:
- `release-data/` has no `flake.nix`,
- the parent flake reads `manifest.json` directly, and
- the package is built from values parsed out of that JSON file.
The same pattern works with remote GitHub sources that are not flakes. The important part is `flake = false`, not the transport.
---
## 3. What the Check Verifies
The check looks at both layers:
- parsed values such as the release name and wave count, and
- the raw JSON text from the input path.
That keeps the example focused on the real distinction: a non-flake input gives you files to read, not outputs to import.
---
## 4. Commands to Try
```bash
cd 41-non-flake-inputs
nix flake metadata
nix build
./result/bin/show-raw-release
nix flake check
```