feat: add inputs' and self' aspects#117
feat: add inputs' and self' aspects#117vic merged 1 commit intodenful:mainfrom HeitorAugustoLN:inputs-self
Conversation
There was a problem hiding this comment.
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
withSystemparameter to enable per-system context injection - Wraps
mainModulecreation withwithSystemto provideinputs'andself'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.
|
Hey, thanks for the PR!
I'm still working on decoupling flake-file from flakes (using unflake) but will keep this open and take a more deeper look later. |
|
Den has a test suite now, and each feature is tested. Could you provide a test that shows it is NOT possible to use |
|
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 |
|
Can you show me an example of where you are trying to use it and are unable to ? How about using We currently depend on |
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 |
|
I haven't tried it but if I'd prefer if we made something like this possible: But we extending a module that is included in all aspects, so all have access to this In other words: being able to contribute to a module that is part of all aspects ? Is it |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { den, withSystem, ... }: | ||
| let | ||
| description = '' | ||
| Provides the `flake-parts` `inputs'` (the flake's inputs with system pre-selected) |
There was a problem hiding this comment.
👍 You are awesome, I like this a lot, den.provides.inputs is an opt-in feature for people who uses flake-parts.
There was a problem hiding this comment.
Not sure about the name, but I like it.
|
I am having some difficulty with the aspects lol, but I might have figured it out |
|
Fixed the aspect issue, any thoughts on why it fails on darwin? |
|
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 |
|
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 Thanks! |
|
Where is it? |
|
Here: https://github.com/vic/den/wiki (it was private haha) |
|
Get published on any file change at https://den.oeiuwq.com/ |
|
Ok! |
|
I improved the descriptions of these aspects in #118, also I am not able to edit the wiki apparently |
|
Oh, Ok. I'll update then wiki tomorrow then. Thanks so much I'll also merge #118 |
Adds
inputs'andself'aspects