Commit 07a7eec
authored
Add standalone flakes to examples (#1539)
## Summary
- add standalone `flake.nix` files for every Nix-backed example
- point each example at `github:indexable-inc/index`
- pin each example to `github:NixOS/nixpkgs/nixos-unstable` and make
Index follow that nixpkgs
- use `ix.nix` as the example entrypoint, not `default.nix` or
`example.nix`
- expose fleet examples under `ix.fleets.default` for the `ix up`
toplevel contract, while preserving `nixosConfigurations`
- update aggregate example discovery to read `examples/**/ix.nix`
Fixes #1537
## Tests
- `nix run nixpkgs#nixfmt -- examples/**/*.nix lib/discovery.nix`
- coverage script: no `examples/**/default.nix` or
`examples/**/example.nix`; every example flake has an `ix.nix`; every
example flake has the Index input, nixos-unstable input, and nixpkgs
follow
- eval script: 20 fleet examples evaluated
`.#ix.fleets.default.planValue.order`; 2 non-Nix OCI examples evaluated
`.#ix.images.default.name`; `nomad-secret-refs` evaluated
`.#checks.x86_64-linux.default.name`; `nixos-switch-multi` evaluated
`.#ix.nixosConfigurations.default.web.config.system.build.toplevel.drvPath`
- aggregate eval: `.#packages.aarch64-darwin.dev-fleet-up.name`,
`.#packages.aarch64-darwin.nginx-lifecycle-up.name`,
`.#packages.aarch64-darwin.ray-cluster-up.name`
(sent by an AI agent via Codex)
<!-- Macroscope's pull request summary starts here -->
<!-- Macroscope will only edit the content between these invisible
markers, and the markers themselves will not be visible in the GitHub
rendered markdown. -->
<!-- If you delete either of the start / end markers from your PR's
description, Macroscope will append its summary at the bottom of the
description. -->
> [!NOTE]
> ### Add standalone flake entrypoints to all examples and rename
`default.nix` to `ix.nix`
> - Each example directory gains a `flake.nix` that imports `./ix.nix`
and exposes standard outputs (`ix.fleets.default`,
`nixosConfigurations`, etc.), making every example runnable directly
with `nix` or `ix up`.
> - All existing `default.nix` entrypoints are renamed to `ix.nix`; no
logic changes in these files.
> - The `dev-fleet` example is restructured: `ix.nix` becomes a `mkDev`
entrypoint and the NixOS module content moves to a new
[`dev.nix`](https://github.com/indexable-inc/index/pull/1539/files#diff-fb2fbe8cb5cba7d162ca3247836edcc33a80e0ffcb38297fb76bdebd868cf2fd).
> -
[`lib/discovery.nix`](https://github.com/indexable-inc/index/pull/1539/files#diff-99ac7778993e1b9c08033c2057dd9cb20220148285ea3f1d1f4e528b82f4a21e)
is updated to target `ix.nix`, filter examples that accept an `index`
argument, and require `nodes` and `planValue` attributes on the result.
> -
[`tests/default.nix`](https://github.com/indexable-inc/index/pull/1539/files#diff-1cc580de297308d93d82f7b72446ae4b98832a8aae3378e9e134102519a0e33a)
is updated to reference `ix.nix` paths and asserts that the `dev-fleet`
example exposes both `ix.nix` and `dev.nix`.
>
> <!-- Macroscope's review summary starts here -->
>
> <sup><a href="https://app.macroscope.com">Macroscope</a> summarized
d12ad20.</sup>
> <!-- Macroscope's review summary ends here -->
>
<!-- macroscope-ui-refresh -->
<!-- Macroscope's pull request summary ends here -->1 parent b900d3a commit 07a7eec
68 files changed
Lines changed: 629 additions & 129 deletions
File tree
- examples
- _non-nix-oci
- debian
- ubuntu
- declared-groups
- dev-fleet
- east-west-firewall
- hermes-agent
- hermes-api-server
- hermes-minecraft-operator
- hermes-telegram
- minecraft-blocks
- minecraft
- crazy-terrain
- factions
- survival
- multi-client-file-sharing
- nginx-lifecycle
- nixos-switch-multi
- nixos-switch
- nomad-secret-refs
- observability-stack
- polyglot-dev
- python-daily-scraper
- ray-cluster
- s3-storage
- synced-github-auth
- lib
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
| 29 | + | |
| 30 | + | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
65 | 64 | | |
66 | 65 | | |
67 | 66 | | |
68 | | - | |
| 67 | + | |
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments