NixOS Module System | 203 Members | |
| 48 Servers |
| Sender | Message | Time |
|---|---|---|
| 5 Jun 2026 | ||
Hard to tell from skim-reading the merge function, but it looks like it is delegating checking & merging to the elemType and should surface type errors.It's possible that there's a v1/v2 checkAndMerge interface bug though, e.g. if the outer or inner type is using the v1 interface and the other part is using v2? | 15:02:11 | |
* Hard to tell from skim-reading the merge function, but it looks like it is delegating checking & merging to the elemType and should surface type errors.It's possible that there's a v1/v2 checkAndMerge interface bug though, e.g. if the outer or inner type is using the v1 interface and the other part is using v2? | 15:02:40 | |
check itself only doing isList pre-dates v2 checkAndMerge, though | 15:03:30 | |
hmmm ok in my real scenario i'm override a nonEmptyListOf's merge with mergeEqualOption, maybe that's why? | 15:04:28 | |
* hmmm ok in my real scenario i'm override a nonEmptyListOf's merge with mergeEqualOption (so that lists don't get merged), maybe that's why? | 15:04:42 | |
| ah yes that's why | 15:06:07 | |
If you're shadowing the merge attribute, then you're also removing any "delegate to elemType" logic unless your replacement merge itself delegates to the original merge. | 15:06:11 | |
ah, i assumed mergeEqualOption would look at the original type but now that i check it doesn't take any argument so it obviously can't know the original type | 15:07:00 | |
| well, i'll try to figure out how to make it work with the non-merging merge; thanks! | 15:07:39 | |
| For a similar example, I had this abomination when trying to extend a submodule's merge function earlier today. | 15:07:46 | |
(aside: maybe it'd make sense for submoduleWith to accept an apply function, similar to an option's apply?) | 15:08:31 | |
| i have this diff to lib/modules.nix, but somehow this is causing the manual to fail to build:
| 15:22:01 | |
| anyone have an idea why? | 15:23:01 | |
| logs are here | 15:23:08 | |
adding some tracing, putting _module.check first fixes the error - but it loses the stats gain | 15:26:44 | |
* aside: maybe it'd make sense for submoduleWith to accept an apply function, similar to an option's apply?EDIT: https://github.com/NixOS/nixpkgs/pull/528474 | 15:32:53 | |
| If i had to guess, if you evaluate unmatchedDefns that changes lazyness | 15:34:35 | |
Pretty sure config._module.check is first on purpose, to short-circuit non-lazy eval | 15:34:36 | |
| In the new line you evaluate unmachtedDefns eagerly, where it was "lazy" before | 15:35:23 | |
| yeah i concur - i guess that's non-lazy lists for you | 15:35:42 | |
| Why did you want to change the order here? | 15:36:44 | |
The logik was if !config._module.check we can short circuit | 15:37:27 | |
* The logic was if !config._module.check we can short circuit | 15:37:30 | |
| Same for freeformType | 15:37:42 | |
| reasoning was that it's almost always empty | 15:37:57 | |
| We dont need to check unmatchedDefns if either of those is set. | 15:37:58 | |
| and for submodules it has a big stats difference | 15:38:07 | |
| 15:38:18 | |
*
| 15:38:27 | |
| Hm then it might be worth tracking down | 15:38:34 | |