docs(nix): use host forwarding example
This commit is contained in:
10
docs/nix.md
10
docs/nix.md
@@ -131,22 +131,22 @@ Use:
|
|||||||
|
|
||||||
### Use `@` for forwarding wrappers
|
### Use `@` for forwarding wrappers
|
||||||
|
|
||||||
Use `@` when a wrapper passes the complete argument set to another module function.
|
Use `@` when a wrapper passes its complete argument set to another function.
|
||||||
Name each argument the wrapper uses before `...`.
|
Name each argument the wrapper uses before `...`.
|
||||||
Forward the bound argument set unchanged.
|
Forward the bound argument set unchanged.
|
||||||
|
|
||||||
Avoid:
|
Avoid:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{ dotfiles, ... }:
|
{ hostName, system ? "x86_64-linux", ... }:
|
||||||
dotfiles.guest { name = "sample"; } { inherit dotfiles; }
|
mkHost { inherit hostName system; }
|
||||||
```
|
```
|
||||||
|
|
||||||
Use:
|
Use:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
args@{ dotfiles, ... }:
|
args@{ hostName, ... }:
|
||||||
dotfiles.guest { name = "sample"; } args
|
mkHost args
|
||||||
```
|
```
|
||||||
|
|
||||||
## `let` Bindings
|
## `let` Bindings
|
||||||
|
|||||||
Reference in New Issue
Block a user