feat: add batteries.user-modules#601
Conversation
Works exactly like batteries.host-modules but in reverse, allowing `host.class`es from the user aspect tree to be projected into onto hosts that include it.
|
It might be better if this battery was explicit as to which user(s) it would apply to. With host -> users it's a 1:many relationship; with users -> host it's a many:1. I'd also like to see some tests to validate behavior/guard against future regressions. Implementing it as a policy is correct. :) Also, we'll need to add it to the batteries docs page after we get the implementation details nailed down. But we can focus on implementation details first. |
Perhaps this could be set in the user aspect, just like
|
|
Okey, I didn't have much time to work on this on the last weeks but I'll do my best.
Maybe? I like it the way it is now. Keeps the user unaware of the hosts it runs in. It just knows what configurations the hosts will have.
Could be. PD: I have been using this branch of |
I like it too. Personally, I think the behavior of
Perhaps we could make it opt-in for both host and user? As in, both user and host requiring the include of |
I think that was the default behaviour before, all users contributing to their hosts, and also pre 0.13 all hosts contributing to all users, so now that we are trying things to be more controlled/explicit (hosts / users opt-in) I agree that having the battery included at user level is like that single user explicitly opting-in, and since Den allows to include for-all users we have best of both worlds (fine grained and everybody opts in) I like the simplicity of the battery, btw. |
I didn't know that. I've only started using Den a couple of days ago, so it was already on 0.17.
I like it too, but |
If you define it that way; yes -- but it doesn't have to. I'll enhance the host.user API soon so it's more clear how you'd configure beyond just den.aspects.username for expressing what the local pipeline resolution should be. |
I disagree, especially when you consider den as a generic resolution pipeline looking to extend to real world infra problems as well. The example I often give is my wife shouldn't be forced to learn and use hyprland just because I've configured it on one of our shared hosts. She should also be free to choose her own stylix themes, or not use stylix at all. Nix's isolation is one of it's core value offerings as a distribution versus other distros where rpm/apt/pacman installing something default installs it for everyone because there is no isolation. Disabling the isolation by default is the wrong choice. I know that there's probably some friction there, but I truly believe that its the right choice. |
I'd prefer if it were the default, but it's okay as long as we can opt-in. I have no strong feelings about this. Also, for your wife's use case, that would be a matter of leaving host config very thin and moving things to her user. For instance, if the host didn't include hyprland, she'd also never get it without manually including it in her user's aspect. Or, if she used the same user in multiple hosts — and thus didn't want a "heavy" user config — it would be a matter of using Again, I have no problems with including a battery. It's just that I'd prefer it as the default behavior because I don't see myself ever not including these batteries, which is why I think this |
|
I generally agree with this, too. But I do yearn for a simple meta-battery that enables all the magic by default just for convenience. :) Like, there's no project where I don't want define-user and hostname batteries. And I want input' and self' on every flake-parts project by default. |
Works exactly like batteries.host-modules but in reverse, allowing
host.classes from the user aspect tree to be projected into onto hosts that include it.Test plan
I added this to my user aspect:
After that I rebuilt and saw no
htopin my system as expected.After including this (
icebearis my main PC):I get
htopas expected.