Skip to content

fix: handle mixed function+attrset defs at provides sub-aspects - #464

Merged
sini merged 2 commits into
mainfrom
fix/issue-448
Apr 17, 2026
Merged

sini merged 2 commits into
mainfrom
fix/issue-448

Conversation

@sini

@sini sini commented Apr 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • When a sub-aspect (_.sub) received both a parametric function and a plain attrset from different modules, providerType's either merge fell back to aspectType which evaluated the function as a NixOS module — failing with "attribute 'host' missing"
  • Add a custom merge on providerType that detects mixed defs and coerces parametric functions to { includes = [fn]; } before merging as aspects
  • Single-def functions keep their identity (preserving functionArgs for namespace export/import per BUG: Exported providers lose function argument reflection #352)

Test plan

  • deadbugs-issue-448 tests: mixed function+attrset merge on both fx and legacy pipelines
  • deadbugs-issue-352 tests still pass (function arg reflection preserved)
  • Full CI suite passes (491/491)

Fixes #448

When a sub-aspect (_.sub) received both a parametric function and a plain
attrset from different modules, providerType's either merge fell back to
aspectType which evaluated the function as a NixOS module — failing with
"attribute 'host' missing" since host comes from parametric context, not
_module.args.

Add a custom merge on providerType that detects mixed defs and coerces
parametric functions to { includes = [fn]; } before merging as aspects.
Single-def functions keep their identity (preserving functionArgs for
namespace export/import per #352).

Fixes #448
@sini sini self-assigned this Apr 17, 2026
@sini sini added allow-ci allow all CI integration tests super-autocompleted "Artificial Intelligence" terms nothing real, "Super Intelligence" is even more of a lie. labels Apr 17, 2026
@vic vic added the merge-approved Approved, merge yourself when ready label Apr 17, 2026
@sini
sini merged commit 6310761 into main Apr 17, 2026
22 of 44 checks passed
@sini
sini deleted the fix/issue-448 branch April 17, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

allow-ci allow all CI integration tests merge-approved Approved, merge yourself when ready super-autocompleted "Artificial Intelligence" terms nothing real, "Super Intelligence" is even more of a lie.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: attribute 'host' missing when a sub-aspect is defined across multiple modules that MIX bare parametric functions with plain attrsets

2 participants