niri: include optional doesnt work #472
|
hey, i have a very wierd question… im using niri with a regualar .config/config.kdl right now, i want to move to wrappers. (also asked in forum, will ask here too) |
Replies: 14 comments 6 replies
|
You should be able to include the file via an However it may cause the niri validate check to fail. If it does fail, |
|
doing just |
Did you do Disabling it trades build time error messages about missing or incorrect fields, in exchange for not checking included out-of-store-paths at build time. It simply runs niri validate on it, so, you can do that at runtime if you still want to see the error message it would have given if any. |
|
no i would rather avoid that i tried optional imports (also in extraConfig), they all get checked by niri validate even if its optional... seems like i have no choice |
|
Unfortunately, yeah if it checks the include paths at build time, and you use a runtime path that isn't there at build time, then yes, you would have to disable that, or it would fail and not build.
^ you could still do that, but using their optional thing would be better. |
|
im not as experienced with nix, took me 20 minutes just to find out how to add optional=true to include, but honestly this seems more like a incosistency with niri validate; should i make a issue? |
|
they have an include optional thing? I don't use niri so I don't know 100% of their options. If they have an include which is meant to be optional, and validate still throws if it isnt there, then yes that is a bug and they should know about it. Filing an issue would be appreciated (include the generated config file for them to look at too of course, don't make them look at nix if they don't want to, but also include the context from here so they know why it matters) It runs it here: |
|
yeah thats exactly what i mean, will make a issue tmrw |
|
Also, to be clear, it is not that weird of a use case 😄 |
|
Weren't optional includes introduced just recently in the latest release (26.04): https://github.com/niri-wm/niri/releases/tag/v26.04 ? The official nixpkgs still provide the 25.11 release though. |
|
Oh! Maybe if we pull from the flake? |
|
@JumpIn-Git would you mind sharing your config? Have you tried pulling the package from their flake and setting |
|
Ok, so I just tried it out. It seems to work... but only if you pull from the flake. But the includes options leave a bit to be desired. We should add something for that. Because I can include = [ { optional = true; } "~/.config/blehIamnothere" ];which is really nice and all... but I can only do it once.... because this is a set... So anything more than that and I am using It would be kinda nice if we could somehow get the ability to also include a list of auto translated values to get added to the ones from the settings set? Cause then we could config.whateverwenameit = [
{ include = [ { optional = true; } "~/.config/blehIamnothere" ]; }
{ include = [ { optional = true; } "~/.config/blehIamnothereagain" ]; }
]; |
|
On the version from nixpkgs On the version from the flake tho, it builds. So, @JumpIn-Git don't file an issue on niri-wm Instead, go try to update the niri package in nixpkgs, and if you can't, file an issue there for them to update. (search for PRs and issues for it already first, so that if there are some, you can boost it instead) |
On the version from nixpkgs