| 3 Apr 2026 |
| shikanime joined the room. | 18:34:05 |
| 4 Apr 2026 |
| Racci set a profile picture. | 05:55:11 |
| 7 Apr 2026 |
| @oleg20082009:matrix.org joined the room. | 21:17:50 |
| @oleg20082009:matrix.org left the room. | 21:37:59 |
| 8 Apr 2026 |
| teumaauss joined the room. | 15:46:49 |
| 10 Apr 2026 |
| ladas552 joined the room. | 20:48:05 |
| 17 Apr 2026 |
| c4lliope set a profile picture. | 08:37:03 |
| c4lliope changed their profile picture. | 08:41:53 |
| @robin:robin.town joined the room. | 18:57:51 |
| @robin:robin.town left the room. | 19:04:02 |
| 18 Apr 2026 |
| Lukas joined the room. | 01:17:12 |
| @rasmata:matrix.org joined the room. | 15:53:09 |
| @rasmata:matrix.org left the room. | 15:53:12 |
| 23 Apr 2026 |
| Maxisthespy joined the room. | 21:25:27 |
| 27 Apr 2026 |
| Ninja joined the room. | 14:34:01 |
| 30 Apr 2026 |
| isabel changed their profile picture. | 18:47:35 |
| 1 May 2026 |
| llakala set a profile picture. | 17:12:42 |
| 3 May 2026 |
| isabel changed their profile picture. | 10:39:10 |
| 8 May 2026 |
| jopejoe1 (4094@39c3) changed their display name from jopejoe1 (4094@epvpn) to jopejoe1. | 08:46:19 |
| 9 May 2026 |
| linj joined the room. | 05:02:21 |
| 11 May 2026 |
| Maëlys joined the room. | 20:40:21 |
| 12 May 2026 |
| Richard Tichý joined the room. | 11:19:41 |
| Michal Koutenský joined the room. | 18:16:59 |
| 14 May 2026 |
| tuhana joined the room. | 15:12:49 |
| 19 May 2026 |
| @snow101:matrix.org left the room. | 08:37:05 |
| amadaluzia changed their profile picture. | 20:58:55 |
| 22 May 2026 |
| polykernel joined the room. | 16:40:58 |
polykernel | What is the best way to propagate checks added by addCheck in the type merge process? I tried overriding functor in the extended type but the functor attached to the type after merging options declarations is not the one I overwrote. | 17:00:24 |
polykernel | Here is a MWE:
{
pkgs ? import <nixpkgs> { },
lib ? pkgs.lib,
}:
let
testSubmodule =
{ config, ... }:
{
freeformType = lib.types.lazyAttrsOf lib.types.raw;
options.a = lib.mkOption {
type = lib.types.int;
default = 0;
};
};
isSubmoduleFn =
m:
let
args = builtins.functionArgs m;
in
args ? lib || args ? config || args ? options;
staticInnerType =
let
baseType = lib.types.addCheck (lib.types.submodule testSubmodule) (
v: builtins.isAttrs v || isSubmoduleFn v
);
in
baseType
// rec {
functor = baseType.functor // {
type =
attrs:
let
mergedType = lib.types.addCheck (lib.types.submoduleWith attrs) (
v: builtins.isAttrs v || isSubmoduleFn v
);
in
mergedType
// {
inherit substSubModules;
functor = mergedType.functor // {
inherit (functor) type;
};
};
};
substSubModules =
m:
lib.types.addCheck (lib.types.submodule m) (v: builtins.isAttrs v || isSubmoduleFn v)
// {
inherit substSubModules;
};
};
dynamicInnerType = lib.types.functionTo staticInnerType;
innerType = lib.types.either staticInnerType dynamicInnerType // rec {
substSubModules =
m:
(lib.types.either (staticInnerType.substSubModules m) (dynamicInnerType.substSubModules m))
// {
inherit substSubModules;
};
};
testType = lib.types.lazyAttrsOf innerType;
optionModule1 = {
options.test = lib.mkOption {
type = testType;
};
};
optionModule2 = {
options.test = lib.mkOption {
type = testType.substSubModules [
{
options.b = lib.mkOption {
type = lib.types.bool;
};
}
];
};
};
staticConfig = {
config.test.random2 = {
b = false;
};
};
dynamicConfig = {
config.test.random1 =
{ arg1 }:
{
a = 1;
};
};
result = lib.evalModules {
modules = [
optionModule1
optionModule2
staticConfig
dynamicConfig
];
};
in
result
| 17:01:39 |
polykernel | The check on staticInnerType gets dropped after the type merge. | 17:02:19 |