NixOS Module System | 156 Members | |
| 30 Servers |
| Sender | Message | Time |
|---|---|---|
| 26 Dec 2025 | ||
| 15:49:41 | ||
| 27 Dec 2025 | ||
| 13:30:50 | ||
| 30 Dec 2025 | ||
| 23:38:40 | ||
| 23:40:10 | ||
| 4 Jan 2026 | ||
| 09:32:00 | ||
| 10:59:43 | ||
| 5 Jan 2026 | ||
| 03:21:02 | ||
| 11 Jan 2026 | ||
| 01:46:23 | ||
| 14:37:00 | ||
| 12 Jan 2026 | ||
| 09:25:24 | ||
| 09:25:57 | ||
| 09:59:43 | ||
| (continues from #nix-lang:nixos.org )
Ah! I didn't know about that channel. Thanks for pointing me here.
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.
No idea what v2 check&merge is, is that opt-in? Is something that's going in soon?
None should match, 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 | |
| 11:22:05 | ||
| 18:59:29 | ||
| 13 Jan 2026 | ||
| 08:26:49 | ||
| 14 Jan 2026 | ||
| 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 There are some action points that i'd like to accomplish and one needs to figure out the order of them:
| 07:29:55 | |
| If you want to help out, doing some PRs i'm happy to answer questions | 07:30:58 | |
| * 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 There are some action points that i'd like to accomplish and one needs to figure out the order of them:
| 07:36:00 | |
| * 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 There are some action points that i'd like to accomplish and one needs to figure out the order of them:
| 07:41:34 | |
| I'd need to spend some time on the implementation of the modules system to be of some help. I don't want to derail the discussion, but I'll just leave here my complaint that nix is lacking a type system and it's being reimplemented at run-time.
Which is a bit absurd. It seems to me that the general feeling in the community is that nix won't get a type system any time soon. Maybe we need something like | 09:17:51 | |
| * I'd need to spend some time on the implementation of the modules system to be of some help. I don't want to derail the discussion, but I'll just leave here my complaint that nix is lacking a type system and it's being reimplemented at run-time.
Which is a bit absurd. It seems to me that the general feeling in the community is that nix won't get a type system any time soon. Maybe we need something like | 09:18:11 | |
| * I'd need to spend some time on the implementation of the modules system to be of some help. I don't want to derail the discussion, but I'll just leave here my complaint that nix is lacking a type system and it's being reimplemented at run-time.
Which is a bit absurd. It seems to me that the general feeling in the community is that nix won't get a type system any time soon. Maybe we need something like | 09:18:42 | |
Honestly, you'll get much more out of experiments with things like
The check function is what the module system uses to check "does this definition match this type". Every type has a
If you're curious about impl, you can use the repl to find where something is defined too:
I.e., "union" types (like In this way, it'd be useless to declare an As I said before, you can work around this using
This is a proposal for how union types can be smarter, by taking advantage of v2 check&merge. Essentially, the v2 system was recently added to Nixpkgs and combines the checking and merging responsibility into a single function called hsjobeki is suggesting that Nixpkgs could distinguish between a union of submodules by selecting the first one that can handle the definition without errors. That's probably a more useful default behavior, although it may have a performance cost and still wouldn't cover all scenarios. E.g. some scenarios don't have a sensible solution; how to handle a module-definition that doesn't define any options? Or defines options that'd be valid in multiple submodule configurations? Or a module that declares additional options? Or how to handle freeform submodules? | 19:15:24 | |
| 20:46:55 | |
| 17 Jan 2026 | ||
I can set internal on an option to make it usable only in nixpkgs. Is there any mechanism to do the opposite, where an option is unusable in-tree but still available to users? The use case is for an option that should be deprecated, but where the replacement is not yet stable enough to produce a warning and steer users toward it. But also, the replacement is widely used within nixpkgs already. | 02:25:32 | |
| warnings | 02:27:04 | |
internal doesn't not affect who can use an option. It only affects whether it is documented. It's effectively the same thing as visible = "shallow". | 12:30:52 | |
* internal doesn't affect who can use an option. It only affects whether it is documented. It's effectively the same thing as visible = "shallow". | 13:05:04 | |
| 18 Jan 2026 | ||
| 14:58:52 | ||