Write all modules with destructured arguments #93
Labels
No labels
blocked
bug
component: fediversity panel
component: nixops4
contributor experience
documentation
estimation high: >3d
estimation low: <2h
estimation mid: <8h
goal: devops
project-management
question
role: sysadmin
security
technical debt
testing
user experience
user story
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Fediversity/Fediversity#93
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is an authoritative decision I'm making here, and maybe we want to record it somewhere. Rationale:
The underlying problem that prompted this issue is that currently some deployment code depends on at least one module to be denoted as a plain attrset, and this needs to be refactored.
You may also specify the
_class
module attribute, which documents and enforces the purpose of the module, and has potential to be a recognizable keyword for those who read the code. They are checked againstclass
, so they also provide a clear error message when, for example, anixosTest
module is imported into a NixOS configuration.Common class declarations would be:
_class = "nixos";
_class = "nixosTest";
_class = "nixops4Resource";
_class = "nixops4Deployment";
A good place is at the top of the module attribute set literal:
Alternatively, instead of specifying
_class
manually, you could usemodules.<class>.<name>
and/or derive that from a directory structure.I could work on upstream documentation for the module syntax if that is deemed necessary.
Do you mean also == "instead of" xor also == "in addition to"?
Does your authoritative decision also hold for modules that are not the only thing in a file? For instance, in a NixOps4 resource:
Should this also be written:
?
Not fully sure, but I tend towards yes, since all the same arguments apply.