!wfudwzqQUiJYJnqfSY:nixos.org

NixOS Module System

211 Members
52 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
4 Jan 2026
@sybearly:matrix.orgSyBearly joined the room.09:32:00
@jappie:jappie.devjappie changed their display name from jasper to jappie.10:59:43
5 Jan 2026
@user262728:synod.imuser262728 joined the room.03:21:02
11 Jan 2026
@ivank:matrix.orgivan joined the room.01:46:23
@sammy:cherrykitten.gaysammy (It/Its) left the room.14:37:00
12 Jan 2026
@arcterus:matrix.orgArcterus joined the room.09:25:24
@weriomat:matrix.orgweriomat joined the room.09:25:57
@bake.monorail:matrix.orgbake.monorail joined the room.09:59:43
@bake.monorail:matrix.orgbake.monorail

(continues from #nix-lang:nixos.org )
Matt Sturgeon:

you're asking a module system question, so NixOS Module System is more suitable 🙂

Ah! I didn't know about that channel. Thanks for pointing me here.

Either by shadowing check with submodule ... // { check = ...; } or extending it using lib.types.addCheck

Mh, I'd need to check how that works before I can fully understand that. Any reading material you suggest? Maybe there's a guide about internals of the modules type system.

Note that these may not work well with v2 check&merge (where checking is partly handled by the merge.v2 function).

No idea what v2 check&merge is, is that opt-in? Is something that's going in soon?

how should an empty module be handled?

None should match, type is a single-element enum with no default, so all of them should fail.

Right now I manually made a "union type" (where everything that a single type would allow, is allowed), and it has already bitten me.

10:04:52
@caiocdcs:tchncs.decaiocdcs joined the room.11:22:05
@isabel:isabelroses.comisabel changed their profile picture.18:59:29
13 Jan 2026
@jopejoe1:matrix.orgjopejoe1 (4094@GPN23) changed their display name from jopejoe1 (4094@39c3) to jopejoe1 (4094@epvpn).08:26:49
14 Jan 2026
@hsjobeki:matrix.orghsjobeki

bake.monorail: Thanks for asking this here. I have some similar ideas. This is currently a limitation of the type system.

We don't have explicit union discriminators.

Because we currently use check as union discriminator.
The check of a submodule is isAttrs x || isFunction x || path.check x so the first submodule type gets picked always.

There are some action points that i'd like to accomplish and one needs to figure out the order of them:

  • Make oneOf the basetype of either. Currently inverted logic.
  • Allow user defined explicit discriminators. Currently: implicitly reusing check def where we should do discriminator merged.value
07:29:55
@hsjobeki:matrix.orghsjobekiIf you want to help out, doing some PRs i'm happy to answer questions07:30:58
@hsjobeki:matrix.orghsjobeki *

bake.monorail: Thanks for asking this here. I have some similar ideas. This is currently a limitation of the type system.

We don't have explicit union discriminators.

Because we currently use check as union discriminator.
The check of a submodule is isAttrs x || isFunction x || path.check x so the first submodule type gets picked always.

There are some action points that i'd like to accomplish and one needs to figure out the order of them:

  • Make oneOf the basetype of either. Currently inverted logic.
  • Allow user defined explicit discriminators. Currently: implicitly reusing check def where we should do something along !merged.headError && discriminator merged.value
07:36:00

Show newer messages


Back to Room ListRoom Version: 10