docs(nix): remove premature let scope rule

This commit is contained in:
2026-08-28 10:20:25 -04:00
parent 09aee329cf
commit a55592f59e

View File

@@ -154,41 +154,6 @@ in
lib.genAttrs hostNames mkHost
```
### Keep bindings in the smallest scope
Place a `let` binding inside the expression that consumes it.
Avoid:
```nix
let
hostNames = lib.attrNames hosts;
in
{
hostSummary = {
inherit hostNames;
count = lib.length hostNames;
};
nixosConfigurations = flakeAssembly.mkHosts (self + "/hosts");
}
```
Use:
```nix
{
hostSummary =
let
hostNames = lib.attrNames hosts;
in
{
inherit hostNames;
count = lib.length hostNames;
};
nixosConfigurations = flakeAssembly.mkHosts (self + "/hosts");
}
```
## Standard Library Calls
### Qualify standard library calls in flake assembly