docs(skills): refine nix let rules
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
- amazon / actualbudget exporter
|
- amazon / actualbudget exporter
|
||||||
- vim-obsidian-markdown
|
- vim-obsidian-markdown
|
||||||
- dictionary cli tool
|
- dictionary cli tool
|
||||||
|
- repo-local Nix style linter
|
||||||
- kitchen.md
|
- kitchen.md
|
||||||
|
|
||||||
# migration
|
# migration
|
||||||
|
|||||||
@@ -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,15 +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} =
|
||||||
|
|||||||
@@ -5,9 +5,11 @@
|
|||||||
### Rule
|
### Rule
|
||||||
|
|
||||||
Do not add a `let` binding only to let sibling values share one expression.
|
Do not add a `let` binding only to let sibling values share one expression.
|
||||||
|
Apply this rule only when one sibling value clearly owns the concept.
|
||||||
When one sibling value owns the concept, reference that sibling value directly.
|
When one sibling value owns the concept, reference that sibling value directly.
|
||||||
When a flake output owns the public value, reference that output through `self`.
|
When a flake output owns the public value, reference that output through `self`.
|
||||||
Do not make an output attrset recursive only to reference sibling outputs.
|
Do not make an output attrset recursive only to reference sibling outputs.
|
||||||
|
Do not apply this rule when a binding names a local constant used to keep sibling assignments in sync.
|
||||||
|
|
||||||
### Rationale
|
### Rationale
|
||||||
|
|
||||||
@@ -25,4 +27,5 @@ Use forward references only for intentional recursion or fixed-point wiring.
|
|||||||
|
|
||||||
Nix permits recursive `let` bindings.
|
Nix permits recursive `let` bindings.
|
||||||
Top-down dependency order makes ordinary wiring easier to read.
|
Top-down dependency order makes ordinary wiring easier to read.
|
||||||
|
This rule can become a linter rule because binding references are mechanically detectable.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user