Skip to content

Conversation

@HeitorAugustoLN
Copy link
Contributor

@HeitorAugustoLN HeitorAugustoLN commented Dec 11, 2025

Adds inputs' and self' aspects

Copilot AI review requested due to automatic review settings December 11, 2025 20:29
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 adds support for inputs' and self' context variables throughout the module system without relying on specialArgs. The implementation uses the withSystem function to inject system-specific inputs and self references into module contexts.

  • Introduces withSystem parameter to enable per-system context injection
  • Wraps mainModule creation with withSystem to provide inputs' and self' from flake-parts
  • Threads the new context variables through all dependency and integration functions

Reviewed changes

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

File Description
modules/options.nix Adds withSystem parameter and passes it to _types.nix
modules/_types.nix Wraps mainModule function with withSystem to inject inputs' and self' into aspect context
modules/aspects/provides/home-manager.nix Updates homeManager function to accept and forward inputs' and self' parameters
modules/aspects/dependencies.nix Updates all dependency functions (osDependencies, osUserDependencies, hmUserDependencies, hmStandaloneDependencies) to accept and propagate inputs' and self'

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

@HeitorAugustoLN HeitorAugustoLN force-pushed the inputs-self branch 2 times, most recently from c892780 to f2c8395 Compare December 11, 2025 20:42
@vic
Copy link
Owner

vic commented Dec 11, 2025

Hey, thanks for the PR!

  • I'm currently trying to decouple as much as possible from flake-parts and trying to reduce dependencies on it and its idioms. In the future I'd like den to be able to work without flakes and without flake-parts, so people using den will be able to choose if using flake-parts, or just evalModules like dendritic-unflake does or falake.

  • What is the specific use for self' or inputs' in this PR ? I mean, if people can use the module-system to have access both of them why should Den include them as this PR does?

I'm still working on decoupling flake-file from flakes (using unflake) but will keep this open and take a more deeper look later.

@vic
Copy link
Owner

vic commented Dec 11, 2025

Den has a test suite now, and each feature is tested. Could you provide a test that shows it is NOT possible to use inputs'/self' unless we merge this PR ?

@HeitorAugustoLN
Copy link
Contributor Author

It is really not possible currently, but yeah, it won't be supported for configurations that aren't using flake-parts, so I will just use inputs.input.packages.${host.system}.package

@HeitorAugustoLN HeitorAugustoLN deleted the inputs-self branch December 11, 2025 22:28
@vic
Copy link
Owner

vic commented Dec 11, 2025

Can you show me an example of where you are trying to use it and are unable to ? How about using withSystem instead ?

We currently depend on withSystem, see

withSystem home.system (

@HeitorAugustoLN
Copy link
Contributor Author

Can you show me an example of where you are trying to use it and are unable to?

I can use it in perSystem or by using withSystem, so if I want to use it in an aspect I would have to use withSystem, but then it would be too verbose.

I currently have one use case that is basically importing my wrapped neovim from another flake with home.packages = [ inputs'.neovim.packages.default ];. since I haven't migrated yet to a dendritic approach, I use specialArgs in https://github.com/HeitorAugustoLN/nix-config/blob/1741a49777865cd1472ba3ad3d207b3dfe9c1abe/flake/configurations.nix#L139-L166

@HeitorAugustoLN HeitorAugustoLN restored the inputs-self branch December 11, 2025 23:48
@HeitorAugustoLN HeitorAugustoLN force-pushed the inputs-self branch 6 times, most recently from 79e7bc7 to 6739104 Compare December 12, 2025 01:38
@vic
Copy link
Owner

vic commented Dec 12, 2025

I haven't tried it but if withSystem gives you access to inputs' could we have a simple aspect that just exposes it ?

I'd prefer if we made something like this possible:

{ withSystem, ... }: {
  den.aspects.provide-system-self = {
    _module.args.self' = (withSystem { self', ... }: self');
  };
}

But we extending a module that is included in all aspects, so all have access to this self' , what do you think ?

In other words: being able to contribute to a module that is part of all aspects ? Is it den.default ?

@HeitorAugustoLN HeitorAugustoLN force-pushed the inputs-self branch 6 times, most recently from 622a6ce to 90adb7e Compare December 12, 2025 02:34
@HeitorAugustoLN HeitorAugustoLN changed the title feat: add inputs' and self' context feat: add inputs' and self' aspects Dec 12, 2025
@HeitorAugustoLN HeitorAugustoLN force-pushed the inputs-self branch 6 times, most recently from 1e9eea4 to 622649b Compare December 12, 2025 04:14
@HeitorAugustoLN HeitorAugustoLN force-pushed the inputs-self branch 6 times, most recently from 103e17c to 66a572a Compare December 12, 2025 05:00
@HeitorAugustoLN
Copy link
Contributor Author

Fixed the aspect issue, any thoughts on why it fails on darwin?

@HeitorAugustoLN HeitorAugustoLN force-pushed the inputs-self branch 2 times, most recently from 6a4351e to 685ddcc Compare December 12, 2025 20:37
@HeitorAugustoLN
Copy link
Contributor Author

HeitorAugustoLN commented Dec 12, 2025

Ok, I understood what went wrong, the host and home we are checking is x86_64-linux only, when we run it through perSystem it uses its respective system such as aarch64-darwin, but the host and home still uses the same system as before

@vic
Copy link
Owner

vic commented Dec 12, 2025

Awesome! I'm merging this!

Can I ask for another favor ? Please update the wiki documentation just so we have a way for people to discover den._.inputs' and den._.self'.

Thanks!

@vic vic merged commit 4d439f4 into vic:main Dec 12, 2025
8 checks passed
@HeitorAugustoLN HeitorAugustoLN deleted the inputs-self branch December 12, 2025 20:58
@HeitorAugustoLN
Copy link
Contributor Author

Where is it?

@vic
Copy link
Owner

vic commented Dec 12, 2025

Here: https://github.com/vic/den/wiki (it was private haha)

@vic
Copy link
Owner

vic commented Dec 12, 2025

Get published on any file change at https://den.oeiuwq.com/

@HeitorAugustoLN
Copy link
Contributor Author

Ok!

@HeitorAugustoLN
Copy link
Contributor Author

HeitorAugustoLN commented Dec 12, 2025

I improved the descriptions of these aspects in #118, also I am not able to edit the wiki apparently

@vic
Copy link
Owner

vic commented Dec 12, 2025

Oh, Ok. I'll update then wiki tomorrow then. Thanks so much I'll also merge #118

vic pushed a commit that referenced this pull request Dec 12, 2025
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.

2 participants