refactor(dotfiles): order default let bindings
This commit is contained in:
@@ -107,7 +107,7 @@
|
|||||||
Review Nix files in entrypoint order:
|
Review Nix files in entrypoint order:
|
||||||
|
|
||||||
- [x] `flake.nix`
|
- [x] `flake.nix`
|
||||||
- [ ] `src/dotfiles/default.nix`
|
- [x] `src/dotfiles/default.nix`
|
||||||
- [ ] `src/dotfiles/util.nix`
|
- [ ] `src/dotfiles/util.nix`
|
||||||
- [ ] `src/dotfiles/formatter.nix`
|
- [ ] `src/dotfiles/formatter.nix`
|
||||||
- [ ] `src/dotfiles/apps.nix`
|
- [ ] `src/dotfiles/apps.nix`
|
||||||
|
|||||||
@@ -19,6 +19,15 @@ let
|
|||||||
root = root + "/modules";
|
root = root + "/modules";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
specialArgs = {
|
||||||
|
inherit
|
||||||
|
inputs
|
||||||
|
self
|
||||||
|
util
|
||||||
|
;
|
||||||
|
registry = registry.collected;
|
||||||
|
};
|
||||||
|
|
||||||
guestModules = import ./guests.nix {
|
guestModules = import ./guests.nix {
|
||||||
inherit
|
inherit
|
||||||
inputs
|
inputs
|
||||||
@@ -30,16 +39,6 @@ let
|
|||||||
repositoryModules = modules;
|
repositoryModules = modules;
|
||||||
root = root + "/guests";
|
root = root + "/guests";
|
||||||
};
|
};
|
||||||
|
|
||||||
specialArgs = {
|
|
||||||
inherit
|
|
||||||
inputs
|
|
||||||
self
|
|
||||||
util
|
|
||||||
;
|
|
||||||
registry = registry.collected;
|
|
||||||
};
|
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
formatter.${system} =
|
formatter.${system} =
|
||||||
|
|||||||
@@ -14,3 +14,15 @@ Do not make an output attrset recursive only to reference sibling outputs.
|
|||||||
Shared convenience bindings hide dependency direction.
|
Shared convenience bindings hide dependency direction.
|
||||||
Explicit references show which value owns a concept and which value consumes it.
|
Explicit references show which value owns a concept and which value consumes it.
|
||||||
|
|
||||||
|
## Order `let` bindings by dependency
|
||||||
|
|
||||||
|
### Rule
|
||||||
|
|
||||||
|
Define a `let` binding before other bindings that reference it.
|
||||||
|
Use forward references only for intentional recursion or fixed-point wiring.
|
||||||
|
|
||||||
|
### Rationale
|
||||||
|
|
||||||
|
Nix permits recursive `let` bindings.
|
||||||
|
Top-down dependency order makes ordinary wiring easier to read.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user