docs(nix): use real flake namespace example
This commit is contained in:
22
docs/nix.md
22
docs/nix.md
@@ -16,17 +16,29 @@ Use `flake.mk<Name>` for assembly functions passed through module arguments.
|
||||
Avoid:
|
||||
|
||||
```nix
|
||||
{
|
||||
lib = projectFunctions;
|
||||
}
|
||||
specialArgs = {
|
||||
lib = flakeLib;
|
||||
};
|
||||
```
|
||||
|
||||
Use:
|
||||
|
||||
```nix
|
||||
specialArgs = {
|
||||
inherit flake;
|
||||
};
|
||||
```
|
||||
|
||||
Then call project functions through `flake` inside modules:
|
||||
|
||||
```nix
|
||||
{
|
||||
lib = nixpkgs.lib;
|
||||
flake.lib = projectFunctions;
|
||||
flake,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
networking.networkmanager.unmanaged = [ "interface-name:${flake.lib.bridgeName 10}" ];
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user