| 12 Mar 2025 |
Sam Lehman | e.g. I'm trying to persist directories using impermanence by enumerating all services*.dataDir options, then appending its value to environment.persistence."/persist".directories with lib.optional config.services.<name>.enable config.services.<name>.dataDir | 12:10:09 |
nbp | Unfortunately no. So far people have been using map within modules to iterate over the individual definitions, and some have used mkMerge / mkIf to make their definitions conditional. I have no found any way to generalize the processing of multiple option definitions into 1 or multiple at the moment. If you have any idea of what might be a good API, feel free to suggest, and people in this channel might be able to provide an implementation (if possible) | 14:18:09 |
| vidariondr joined the room. | 21:07:51 |
| 22 Mar 2025 |
| isabel joined the room. | 00:42:48 |
| vaw joined the room. | 21:26:12 |
| 27 Mar 2025 |
| ·☽•Nameless☆•777 · ± changed their profile picture. | 04:46:05 |
| ·☽•Nameless☆•777 · ± changed their profile picture. | 07:58:24 |
| 1 Apr 2025 |
| maka_77x joined the room. | 20:03:47 |
| 3 Apr 2025 |
| NixOS Moderation Bot banned @cafkafk:fem.gg (<no reason supplied>). | 11:42:04 |
| 4 Apr 2025 |
| NixOS Moderation Bot unbanned @cafkafk:fem.gg. | 06:12:50 |
| 8 Apr 2025 |
| ·☽•Nameless☆•777 · ± changed their profile picture. | 17:39:03 |
| 10 Apr 2025 |
| anselmetombarel joined the room. | 14:47:57 |
| 16 Apr 2025 |
| ·☽•Nameless☆•777 · ± changed their profile picture. | 06:50:41 |
| Alexandru Tocar joined the room. | 11:47:32 |
| 18 Apr 2025 |
| @cirnolovetech:matrix.org joined the room. | 01:05:05 |
| fabaff joined the room. | 18:03:01 |
| 19 Apr 2025 |
| jopejoe1 (4094@39c3) changed their display name from jopejoe1 to jopejoe1 (4094@eh22). | 13:01:33 |
| ·☽•Nameless☆•777 · ± changed their profile picture. | 14:32:34 |
| @accelbread:matrix.org left the room. | 20:30:31 |
| 22 Apr 2025 |
| @cirnolovetech:matrix.org left the room. | 09:31:37 |
| 25 Apr 2025 |
| @creepinson:matrix.org joined the room. | 23:38:39 |
| 29 Apr 2025 |
| n8henrie joined the room. | 18:04:14 |
| 1 May 2025 |
| Rosuavio changed their display name from Rosario Pulella to Rosuavio. | 20:08:44 |
| 8 May 2025 |
| isabel changed their profile picture. | 08:57:53 |
| isabel changed their profile picture. | 08:57:59 |
| ·☽•Nameless☆•777 · ± changed their profile picture. | 13:26:34 |
| 16 May 2025 |
SomeoneSerge (back on matrix) | I never acquainted with types.nix, is there some fundamental reason that either of two freeform submodules couldn't work when left and right have disjoint explicit options?
with import <nixpkgs/lib>;
evalModules {
modules = [
{
options.foo = mkOption {
type =
types.either
(types.submodule {
freeformType = types.attrsOf types.str;
options.marker_a = mkOption {
type = types.str;
};
})
(
types.submodule {
freeformType = types.attrsOf types.str;
options.marker_b = mkOption {
type = types.str;
};
}
);
};
config.foo = {
marker_b = "bar";
};
}
];
}
{ foo = { marker_a = «error: The option `foo.marker_a' was accessed but has no value defined. Try setting
the option.»; marker_b = "bar"; }; }
| 19:49:57 |
Matt Sturgeon | I believe the issue is the left and right type's check function.
either will use whichever type fist passes check value, and iirc submodules just use something like check = isAttrs
| 19:52:25 |
h7x4 | Some of the "container types" don't really check what's inside before being evaluated at a later stage. I believe this is the case for submodules, listOf and attrsOf. As a hack, you can add those checks with lib.types.addCheck. Same scenario with either and oneOf. | 19:53:46 |
Matt Sturgeon | It's intentional that the submodule-type's check function is not very restrictive, since you can assign any module to a submodule and it is down to the submodule's configuration to evaluate and merge its own definitions internally. | 19:53:58 |