mirror of
https://gitlab.com/TECHNOFAB/nixlets.git
synced 2026-03-22 10:39:27 +01:00
docs: document importing nixlets
This commit is contained in:
parent
2c21317f45
commit
906cd9db2d
3 changed files with 45 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ This is all that's needed:
|
||||||
```nix
|
```nix
|
||||||
(<nixlet>).mkDocs {
|
(<nixlet>).mkDocs {
|
||||||
# Params:
|
# Params:
|
||||||
|
# fullValues ? false,
|
||||||
# transformOptions ? opt: opt,
|
# transformOptions ? opt: opt,
|
||||||
# filter ? _: true,
|
# filter ? _: true,
|
||||||
# headingDepth ? 3,
|
# headingDepth ? 3,
|
||||||
|
|
@ -36,3 +37,18 @@ string
|
||||||
"Hello world!"
|
"Hello world!"
|
||||||
```
|
```
|
||||||
````
|
````
|
||||||
|
|
||||||
|
The `fullValues` param controls whether the docs should include dependency Nixlets.
|
||||||
|
For example, when defining `postgres` as a dependency, by default the docs would not
|
||||||
|
include these options. If it's `true`, everything is included.
|
||||||
|
|
||||||
|
Dependency Nixlets' options which you override from your own `values.nix` will show both
|
||||||
|
default values:
|
||||||
|
|
||||||
|
````md
|
||||||
|
**Overridden value**:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
<the overridden value set in values.nix>
|
||||||
|
```
|
||||||
|
````
|
||||||
|
|
|
||||||
28
docs/importing.md
Normal file
28
docs/importing.md
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
# Importing Nixlets
|
||||||
|
|
||||||
|
Nixlets can now define dependency Nixlets and handle them similarly to how nested
|
||||||
|
Helm Charts work.
|
||||||
|
|
||||||
|
## Importing
|
||||||
|
|
||||||
|
To define a dependency Nixlet, give it a name and pass the Nixlet as a value:
|
||||||
|
|
||||||
|
```nix title="default.nix of Nixlet"
|
||||||
|
nixlet.dependencies."postgres" = <any nixlet>;
|
||||||
|
```
|
||||||
|
|
||||||
|
`<any nixlet>` here could be stuff like `nixlet-lib.fetchNixletFromGitlab {...}`,
|
||||||
|
`nixlet-lib.fetchNixlet <url> <sha>`, etc.
|
||||||
|
|
||||||
|
## Defining Values
|
||||||
|
|
||||||
|
You can pre-define values for dependency Nixlets like this:
|
||||||
|
|
||||||
|
```nix title="values.nix of Nixlet"
|
||||||
|
options = {
|
||||||
|
# options for the current Nixlet
|
||||||
|
};
|
||||||
|
# overwriting the default of dependency Nixlets (the user can still overwrite this)
|
||||||
|
config."postgres".replicaCount = 10;
|
||||||
|
```
|
||||||
|
|
||||||
|
|
@ -61,6 +61,7 @@ in
|
||||||
{"Creating Nixlets" = "creation.md";}
|
{"Creating Nixlets" = "creation.md";}
|
||||||
{"Packaging" = "packaging.md";}
|
{"Packaging" = "packaging.md";}
|
||||||
{"Usage" = "usage.md";}
|
{"Usage" = "usage.md";}
|
||||||
|
{"Importing" = "importing.md";}
|
||||||
{"Generating Docs" = "generating_docs.md";}
|
{"Generating Docs" = "generating_docs.md";}
|
||||||
{"Secrets" = "secrets.md";}
|
{"Secrets" = "secrets.md";}
|
||||||
{"Options" = "options.md";}
|
{"Options" = "options.md";}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue