From a55592f59e94f9c52aebf05d877c3c0c89a5948a Mon Sep 17 00:00:00 2001 From: alexion Date: Fri, 28 Aug 2026 10:20:25 -0400 Subject: [PATCH] docs(nix): remove premature let scope rule --- docs/nix.md | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/docs/nix.md b/docs/nix.md index 3b62482..de2a1e0 100644 --- a/docs/nix.md +++ b/docs/nix.md @@ -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