Skip to content

Conversation

@vic
Copy link
Owner

@vic vic commented Nov 13, 2025

Fixes #84.

This PR removes the directional contexts fromHost and fromUser. Now people can include funcitons like:

den.default.includes = [
  ({ user, ...}: { nixos.some-array = [ user.name ]; })
];

And values are not duplicated now. Added test based on report from #84.

This also simplified a lot the number of contexts we have. Still have to update documentation about contexts.

@vic vic force-pushed the directional branch 2 times, most recently from c902790 to 6f14a84 Compare November 13, 2025 08:08
@vic vic marked this pull request as ready for review November 13, 2025 08:09
Copilot AI review requested due to automatic review settings November 13, 2025 08:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the directional context parameters (fromUser, fromHost, OS, HM) from the aspect system, simplifying the API and reducing boilerplate. The changes streamline how aspects receive and propagate context by using direct parameter patterns instead of directional indicators.

  • Refactored core parametric functions to use direct context passing instead of directional wrappers
  • Updated aspect functors to explicitly take and pass context types (OS, HM)
  • Simplified example code by removing unused directional context parameters

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
templates/examples/modules/_example/ci/standalone-hm-special-args-osconfig.nix Added ... parameter to accept additional context arguments
templates/examples/modules/_example/ci/one-os-package-per-user.nix Removed OS and fromUser directional parameters and helper wrapper
templates/examples/modules/_example/ci/host-user-conditional-hm.nix Removed HM directional parameter and helper wrapper, simplified conditional logic
templates/default/modules/aspects/eg/routes.nix Simplified routing implementation by removing directional wrappers and using direct context application
nix/lib.nix Reversed merge order in parametric.expands from attrs // ctx to ctx // attrs
modules/aspects/provides/user-shell.nix Replaced exactly wrappers with direct parameter patterns and explicit parametric.atLeast
modules/aspects/provides/home-manager.nix Updated to pass HM and host directly in context instead of nested directional structure
modules/aspects/dependencies.nix Major refactor splitting dependencies into separate OS and HM paths without directional context indicators
modules/aspects/definition.nix Updated aspect functors to explicitly take context types (HM/OS) and use new parametric patterns

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vic vic changed the title remove directional contexts Fixed dependencies, removed directional contexts, and prevent duplication from functions included in den.default. Nov 13, 2025
@vic vic merged commit bab28b5 into main Nov 13, 2025
8 checks passed
@vic vic deleted the directional branch November 13, 2025 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

den.default.includes function duplicating configuration values

2 participants