Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the context structure in the aspect system to improve API clarity. Instead of using flat fromUser/toHost and fromHost/toUser parameters, the new API uses nested structures userToHost (with .user and .host fields) and hostToUser (with .host and .user fields), making the direction of contribution more explicit.
Key Changes:
- Replaced
{ fromUser, toHost }parameter pattern with{ userToHost, ... }whereuserToHostcontains.userand.hostfields - Replaced
{ fromHost, toUser }parameter pattern with{ hostToUser, ... }wherehostToUsercontains.hostand.userfields - Updated all aspect definitions and examples to use the new nested context structure
- Added test coverage for the new
userToHostcontext pattern - Improved code maintainability by using
inheritdestructuring consistently
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| templates/default/modules/_profile/users/fido/common-host-env.nix | Updated user-to-host contribution to use nested userToHost.user and userToHost.host structure |
| templates/default/modules/_profile/profiles/single-user-is-admin.nix | Refactored to use userToHost context with destructuring, added __functor for proper context propagation, simplified includes logic |
| templates/default/modules/_profile/hosts/bones/common-user-env.nix | Updated host-to-user contribution to use nested hostToUser.host and hostToUser.user structure |
| templates/default/modules/_example/aspects.nix | Updated example aspects to demonstrate the new userToHost and hostToUser API patterns |
| modules/aspects/provides/user-shell.nix | Refactored userToHostContext to destructure userToHost and access nested user field |
| modules/aspects/provides/primary-user.nix | Updated to destructure userToHost into host and user for cleaner code |
| modules/aspects/provides/define-user.nix | Refactored to use destructured userToHost context with explicit inherit declaration |
| modules/aspects/dependencies.nix | Core implementation of the new nested context structures in hostIncludesFromUsers and userIncludesFromHost functions |
| checkmate/tests/aspect-functor.nix | Added test case for the new userToHost context pattern to ensure proper functor behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
{ userToHost } and { hostToUser } contexts.{ userToHost } and { hostToUser } contexts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of previous:
{ fromUser, toHost }and{ fromHost, toUser }.The reason is detailed at #47.
Closes #47.