feat(wrapperModules.quickshell): add option to set component's module#553
feat(wrapperModules.quickshell): add option to set component's module#553ormoyo wants to merge 2 commits into
Conversation
5bc7250 to
5bd3d08
Compare
|
There are a lot of implications and possible ways to handle this, so give me a moment. I did not know about this either. I wonder if we can do something recursive with just a bool for "capitalize me" or not? I can look into it too I have been interested in quickshell recently I do prefer this over the other PR's approach that disables all the stuff but I wonder what I can cook up if I think about it a bit. If I am drawing a blank, this design seems to address the issue and I am OK with going with it? Except it is still capitalizing and suffixing |
| relPath = makeForce "${config.binName}-config/${capitalizedName}.qml"; | ||
| relPath = makeForce "${config.binName}-config/${ | ||
| if val.module != null then "${lib.replaceString "." "/" val.module}/" else "" | ||
| }${capitalizedName}.qml"; |
There was a problem hiding this comment.
It is still doing this capitalize .qml thing in the module case.
|
So, I'm somewhat drawing a blank, so, once we fix the autocapitalization thing, I think this is a fine approach, but I am thinking people who already have a quickshell config might not want to worry about all this. To be fair, they don't have to use this module, they are free to provide a directory to quickshell themselves { config, lib, wlib, pkgs, ... }: {
imports = [ wlib.modules.default ];
package = pkgs.quickshell;
flags."--path" = ./mypath;
}But I anticipate that a good number of people won't really realize how simple that is and will just complain about the lack of an option to just use a dir. Rather than passing config.generated.placeholder to --path directly, what we could do, is make a configDir option, and make config.generated.placeholder its default value, and pass config.configDir to --path instead. This way we dont have a bunch of conditional logic, the dir will still be generated so people can still include it if they wish from the dir the pass, and such, but people can easily just pass their own dir. |
|
I think your recursive idea fits better. With it, external quickshell components can be imported like: It's also more similar to the My Even if you deleted that comment, I think it has a lot of merit for the recursive type. |
5bd3d08 to
ef59977
Compare
|
It the meantime, I've disabled auto capitalization for linked components (it's using From what I saw, quickshell only imports components with a capital letter, so I kept that for inlined components. |
|
I went ahead and merged the other PR in the meantime. We should have an option like that, and they fixed up their implementation to be much less impactful on our logic for the option. The problem I am having, is the recursive type I put there, I deleted because it was awkward to use. I am thinking of a few different designs instead, which are less ambiguous as to what is a new layer of nesting and what is a value. |
|
For me, what comes to mind is using I know it's still quite similar to your recursive type but I just don't see how is it worse then the generic I made a commit for it as showcase |
…h recursive attrset
19f1f72 to
774a7c8
Compare
Fixes the issue fixed on #552 but in a declarative manner.
Basically, to allow nested components inside sub-directories to be imported with
import qs.xxx.xxx.My extra solution is to add the option
components.<name>.moduleand make components an attrset of specs. (To make no breaking changes)