Skip to content

Commit ea9b352

Browse files
committed
chore: Merge flakes.md with getting-started-with-flakes.md
Forward traffic from old URL
1 parent e184601 commit ea9b352

6 files changed

Lines changed: 41 additions & 126 deletions

File tree

book.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,4 @@ follow-web-links = false
4747

4848
# Redirecting because of typos and restructuring
4949
"getting-startet-with-nix-flakes.html" = "getting-started-with-flakes.html"
50+
"flakes.html" = "getting-started-with-flakes.html"

src/SUMMARY.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
- [Differences between terranix and HCL](terranix-vs-hcl.md)
1212
- [Functions](functions.md)
1313
- [Modules](modules.md)
14-
- [terranix via nix flakes](flakes.md)
1514

1615
# News
1716

src/flakes.md

Lines changed: 0 additions & 119 deletions
This file was deleted.

src/getting-started-with-flakes.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@
33
[Nix flakes](https://nixos.wiki/wiki/Flakes)
44
make dependency management of modules and packages much easier.
55

6-
Deeper look at terranix and nix flakes is done in the
7-
[flake chapter](flakes.md).
6+
## Quick start from template
7+
8+
The fastest way to get started is with the terranix flake template:
9+
10+
```shell
11+
nix flake init --template github:terranix/terranix-examples
12+
```
13+
14+
This creates a `flake.nix` and `config.nix` you can build right away.
815

916
## A minimal flake.nix
1017

11-
Extending [Getting started](./getting-started.md), this minimal flake your terranix resources are defined in `config.nix`:
18+
Extending [Getting started](./getting-started.md), this minimal flake defines your terranix resources in `config.nix`:
1219

1320
```nix
1421
{
@@ -98,3 +105,29 @@ You can create Nix flake _apps_ that let you run:
98105
};
99106
}
100107
```
108+
109+
## Writing terranix modules
110+
111+
You can scaffold a new terranix module with:
112+
113+
```shell
114+
nix flake init --template "github:terranix/terranix-examples#module"
115+
```
116+
117+
A terranix module flake should provide the following outputs:
118+
119+
- `terranixModules.<name>` — individual modules
120+
- `terranixModule` — all `terranixModules` combined
121+
122+
The function `lib.terranixOptions` can render an `options.json` for your module,
123+
which is useful for generating documentation. See the
124+
[terranix-module-github](https://github.com/terranix/terranix-module-github)
125+
repository for an example.
126+
127+
For more on the module system itself, see the [Modules](modules.md) page.
128+
129+
## Next steps
130+
131+
- [terranix and flake modules](terranix-and-flake-modules.md) — use flake-parts to manage terranix configurations declaratively
132+
- [Evaluating terranix configurations](eval-terranix-configuration.md) — inspect your Terraform configuration in `nix repl`
133+
- [Customizing the Terraform binary](terraform-wrapper.md) — use OpenTofu, bundle plugins, or inject secrets

src/modules.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ config = mkAssert (cfg.parameter != "fail") "parameter is set to fail!" {
8181
};
8282
```
8383

84-
## provide terranix modules using nix flakes
84+
## Provide terranix modules using nix flakes
8585

8686
Have a look at
87-
[the flake documentation](flakes.md#writing-terranix-modules).
87+
[Writing terranix modules](getting-started-with-flakes.md#writing-terranix-modules)
88+
in the flakes documentation.

src/news-2021-11-17_release-2.5.2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ for your input on this release.
1313
- add terranixOptionAst
1414

1515
Have a look at
16-
[the flakes documentation](flakes.md#using-terranixconfigurationast-or-terranixconfigurationast)
16+
[Evaluating terranix configurations](eval-terranix-configuration.md)
1717
if you want to know how to use these functions.

0 commit comments

Comments
 (0)