You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here we are. My nix-fu isn't great, but maybe I found an issue with this function. I'm trying to use countAttrs as done in this assertion.
I have a similar setup for my WMs, like that:
cfgXorg=config.user-modules.desktop.xorg;cfgWayland=config.user-modules.desktop.wayland;
...
{assertion=(countAttrs(n: v: n=="enable"&&v)cfgXorg)<2;message="[Xorg] Can't have more than one WM/DE enable at a time.";}{assertion=(countAttrs(n: v: n=="enable"&&v)cfgWayland)<2;message="[Wayland] Can't have more than one WM/DE enable at a time.";}
Sorry for only noticing this issue now, and you've probably already figured this out by now, but the problem is with the predicate function. Yours is only searching for a top-level enabled property, and not nested ones. They'd need to be rewritten to:
{assertion=(countAttrs(_: v: v.enableorfalse)cfgXorg)<2;message="[Xorg] Can't have more than one WM/DE enable at a time.";}{assertion=(countAttrs(_: v: v.enableorfalse)cfgWayland)<2;message="[Wayland] Can't have more than one WM/DE enable at a time.";}
What did you expect to happen?
Here we are. My nix-fu isn't great, but maybe I found an issue with this function. I'm trying to use
countAttrs
as done in this assertion.I have a similar setup for my WMs, like that:
Something like this should print a backtrace!
What actually happened?
The evaluation continues, instead of printing the backtrace.
Describe your attempts to resolve the issue
No response
Steps to reproduce
Enable at least two WMs (I'm using your functions for the same purpose)
Package commit
089f1a9
System Information
No response
The text was updated successfully, but these errors were encountered: