!wfudwzqQUiJYJnqfSY:nixos.org

NixOS Module System

202 Members
47 Servers

Load older messages


SenderMessageTime
10 Jun 2026
@mattsturg:matrix.orgMatt SturgeonPR's been sat ready for review, waiting on discussion around the proposed micro-optimisations 😉12:42:36
@mattsturg:matrix.orgMatt SturgeonAt this point I wouldn't be opposed to landing it as-is, taking any small performance hit for now, and dealing with optimisations in their own PRs12:44:25
@hsjobeki:matrix.orghsjobekiI wouldnt worry to much about the small performance differences. My biggest concern is that we had to fix github.com/NixOS/nixpkgs/pull/525738 And there might be more out there , not in nixpkgs12:46:48
@hsjobeki:matrix.orghsjobeki* I wouldnt worry to much about the small performance differences. My biggest concern is that we had to fix https://github.com/NixOS/nixpkgs/pull/525738 And there might be more out there , not in nixpkgs12:47:01
@mattsturg:matrix.orgMatt Sturgeon Honestly, my view on that is that every "add V2 support to X type" will break some ad-hoc check or merge override. And that there's not much we can do about finding every single case, other than look for them with grep and evals, and wait for bug reports about the rest. 12:49:27
@mattsturg:matrix.orgMatt SturgeonHow did you handle this on the original "add V2 to most core types" PR?12:50:42
@toonn:matrix.orgtoonnI don't think nullOr having merge.v2 would help with my particular problem. This is a situation where there's an override dependent on another option. So whether or not the option is required depends on the value of the other option.12:51:23
@hsjobeki:matrix.orghsjobekiSo: Your "isRequired" does not depend on whether the option is defined at all?12:54:16
@hsjobeki:matrix.orghsjobeki* So: your "isRequired" does not depend on whether the option is defined at all?12:54:33
@mattsturg:matrix.orgMatt Sturgeon Yes, you can only evaluate isDefined for a given module graph. If you add more modules (e.g. modules that define the module, directly or indirectly) then you will get a different result. 12:54:52
@mattsturg:matrix.orgMatt Sturgeon* Yes, you can only evaluate `isDefined` for a given module graph. If you add more modules (e.g. modules that define the option, directly or indirectly) then you will get a different result. I think that's intuitive?12:55:23
@hsjobeki:matrix.orghsjobekiSurprisingly few reports happened ^^ and we touched basically all composition types12:55:43
@toonn:matrix.orgtoonn Yes, we're talking about a specification that tells a user ahead of time what options they need to supply and what options they can supply. 12:59:00
@mattsturg:matrix.orgMatt Sturgeon
In reply to @hsjobeki:matrix.org
Surprisingly few reports happened ^^ and we touched basically all composition types
Adding v2 to one type is inherently lower risk than adding it to almost all composable types. I'd say we take the same "what will be will be" approach in all "add v2" PRs; in my view you've already gone above and beyond by finding the displayManager issue.
13:00:18
@mattsturg:matrix.orgMatt Sturgeon
In reply to @toonn:matrix.org
Yes, we're talking about a specification that tells a user ahead of time what options they need to supply and what options they can supply.

It sounds like you're trying to compute a concept that doesn't exist in the module system.

You can approximate it, with isDefined on a base module eval; i.e. an eval without user-defined modules (which is what getSubOptions provides).

But if you consider "is defined depends on other conditional definitions", you cannot evaluate "is sometimes required" from a single eval. We usually rely on option-docs to convey those kinda conditional and situational relationships.

At the end of the day, all you can compute is "for this module graph, is X option defined". Typically, docs use a base module graph without user definitions, and configs use an extended graph with user definitions.

13:05:39
@hsjobeki:matrix.orghsjobeki

I'd say i'm leaning towards:

the nullor-hoist-v2-check variant
what about llakala ?
https://github.com/NixOS/nixpkgs/pull/525519

13:14:13
@toonn:matrix.orgtoonnYeah, that's what I thought. It's unfortunate because it means either being too strict in what I accept or not strict enough. Recomputing at a later time is possible but doesn't help with the fact that at any time the result is either too strict or not strict enough.13:18:55
@llakala:matrix.orgllakalais the hoisting just readability compared to nullor-b?13:24:42
@mattsturg:matrix.orgMatt SturgeonFractionally lower lookups, even more fractionally higher everything else IIRC13:25:46
@llakala:matrix.orgllakalaim fine with nullor-v2 or the hoist version13:27:46
@llakala:matrix.orgllakalato be clear I doubt all this will have that bad of a real-time diff13:27:57
@llakala:matrix.orgllakalaand I've got a lot of other PRs up to hopefully alleviate it13:28:07
@llakala:matrix.orgllakala i just wanted to minimize the regression and I think we've done that well enough 13:28:27
@llakala:matrix.orgllakalareview on https://github.com/NixOS/nixpkgs/pull/517881 and https://github.com/NixOS/nixpkgs/pull/528010 would be great btw13:34:18
@hsjobeki:matrix.orghsjobekiWill try to do the first one later13:46:47
@hsjobeki:matrix.orghsjobeki llakala: you can also review this one :
https://github.com/NixOS/nixpkgs/pull/510713
13:59:04
@hsjobeki:matrix.orghsjobekiRemoves 3% opUpdates13:59:55
@mattsturg:matrix.orgMatt Sturgeon

+12-153

🚀 I was actually reading the defaultFunctor code the other day to try and understand whether symmetrical addCheck and postTransform type-merging was possible (spoilers: no). It should be much more understandable with wrapped removed!

14:05:53
12 Jun 2026
@opandddd:matrix.orgSapii/Saperson changed their display name from Sapii to Sapii/Saperson.01:24:37
13 Jun 2026
@klea:catgirl.cloudklea (she/her) joined the room.21:44:06

Show newer messages


Back to Room ListRoom Version: 10