!tDnwWRNkmmYtMXfaZl:nixos.org

Nix Language

1872 Members
Nix programming language345 Servers

Load older messages


SenderMessageTime
28 May 2026
@hsjobeki:matrix.orghsjobeki Yes all is the attribute name from the default. Its attrs.<name> depending on what is defined 09:36:13
@hsjobeki:matrix.orghsjobeki But also depends; if the user defined something with a higher prio it would discard all 09:37:58
@toonn:matrix.orgtoonn So there's no guaranteed way to actually get the defined options? 11:41:48
@qyriad:katesiria.orgQyriad options.services.mastodon.sidekiqProcesses.valueMeta.attrs.all.configuration.options does 11:59:34
@toonn:matrix.orgtoonn Qyriad: What I'm saying is that the `all` in that attrPath is kinda random. If they happened to have called it "everything", the path would be different, and more importantly, what if the default was `{}` would the options types not be accessible at all? 12:06:29
@toonn:matrix.orgtoonn (BTW, Qyriad, I opened a Lix PR re stricter attrname documentation, https://gerrit.lix.systems/c/lix/+/5579) 12:08:48
@qyriad:katesiria.orgQyriadoh shit, thank you!12:12:04
@toonn:matrix.orgtoonn Np, it's such a trivial change that there's really no rush. 12:19:21
@mattsturg:matrix.orgMatt Sturgeon
In reply to @toonn:matrix.org
Qyriad: What I'm saying is that the `all` in that attrPath is kinda random. If they happened to have called it "everything", the path would be different, and more importantly, what if the default was `{}` would the options types not be accessible at all?
Surely for an attrsOf you would consume it "for each" defined attr? In this case you could mapAttrs over valueMeta to get each defined attr's submodule configuration.
13:21:57
@toonn:matrix.orgtoonn MattSturgeon: What defined attrs? I'm working with the option definitions not a realized configuration. 13:36:27
@toonn:matrix.orgtoonn Another submodule whose options I can't get at through valueMeta is pixelfed.nginx, `(head (head (services.pixelfed.nginx.type.functor.payload.elemType.functor.payload.modules)).imports).options` 13:37:13
@mattsturg:matrix.orgMatt Sturgeon

In an attrsOf submodule type, the "definitions" are modules.

The submodule's valueOf.configuration is the submodule's configuration (its options, config, etc).

The attrsOf's valueMeta.attrs is the attrsOf definitions' valueMetas.

The attrsOf type's merge function creates the attrs attr in valueMeta.

So if I have an option foo of type attrsOf, I can define foo.bar = {} and that will result in options.foo.valueMeta.attrs.bar.

Default values are also definitions (just with a low override priority). So in your earlier example all was from the default definition (its value being a module for the services.mastodon.sidekiqProcesses submodule-type to merge).

13:48:25
@mattsturg:matrix.orgMatt Sturgeon *

In an attrsOf submodule type, the "definitions" are attrsets of modules.

The submodule's valueOf.configuration is the submodule's configuration (its options, config, etc).

The attrsOf's valueMeta.attrs is the attrsOf definitions' valueMetas.

The attrsOf type's merge function creates the attrs attr in valueMeta.

So if I have an option foo of type attrsOf, I can define foo.bar = {} and that will result in options.foo.valueMeta.attrs.bar.

Default values are also definitions (just with a low override priority). So in your earlier example all was from the default definition (its value being a module for the services.mastodon.sidekiqProcesses submodule-type to merge).

13:55:06
@mattsturg:matrix.orgMatt Sturgeon *

In an attrsOf submodule type, the "definitions" are attrsets of modules.

The submodule's valueOf.configuration is the submodule's configuration (its options, config, etc).

The attrsOf's valueMeta.attrs is the attrsOf definitions' valueMetas.

The attrsOf type's merge function creates the attrs attr in valueMeta (here).

So if I have an option foo of type attrsOf, I can define foo.bar = {} and that will result in options.foo.valueMeta.attrs.bar.

Default values are also definitions (just with a low override priority). So in your earlier example all was from the default definition (its value being a module for the services.mastodon.sidekiqProcesses submodule-type to merge).

13:57:04
@mattsturg:matrix.orgMatt Sturgeon *

In an attrsOf submodule type, the "definitions" are attrsets of modules.

The submodule's valueOf.configuration is the submodule's configuration (its options, config, etc). See here.

The attrsOf's valueMeta.attrs is the attrsOf definitions' valueMetas.

The attrsOf type's merge function creates the attrs attr in valueMeta (here).

So if I have an option foo of type attrsOf, I can define foo.bar = {} and that will result in options.foo.valueMeta.attrs.bar.

Default values are also definitions (just with a low override priority). So in your earlier example all was from the default definition (its value being a module for the services.mastodon.sidekiqProcesses submodule-type to merge).

14:00:14
@lumi:the-apothecary.club@lumi:the-apothecary.club changed their profile picture.16:12:26
@toonn:matrix.orgtoonn The valueOf you describe sounds like what I actually want but I haven't seen it so far. Usually valueMeta is accompanied by value. 19:54:12
@hsjobeki:matrix.orghsjobeki
In reply to @toonn:matrix.org
Another submodule whose options I can't get at through valueMeta is pixelfed.nginx, `(head (head (services.pixelfed.nginx.type.functor.payload.elemType.functor.payload.modules)).imports).options`
This is the type. Which doesn't carry the value nor the valueMeta. Qyriad showed correctly how to get the options of each attrs. You need to replace 'all' with a loop variable if you don't know it.
20:17:38
@hsjobeki:matrix.orghsjobeki* This is the type. Which doesn't carry the value nor the valueMeta. Qyriad showed correctly how to get the options of each attrs. You need to replace 'all' with a loop variable if you don't know the path or if you are mapping something 20:18:09
@toonn:matrix.orgtoonn hsjobeki: But `services.pixelfed.nginx.valueMeta` is `{}`. Not sure what a "loop variable" is, I assume you mean looping over all the attrs? 20:48:41
29 May 2026
@mattsturg:matrix.orgMatt Sturgeon Sorry valueOf was a typo. I meant valueMeta. By "loop" we mean use mapAttrs. 00:21:12
@mattsturg:matrix.orgMatt Sturgeon
sidekiqProcessOpts =
  mapAttrs
    (name: valueMeta: valueMeta.configuration.options)
    options.services.mastodon.sidekiqProcesses.valueMeta.attrs;
00:24:44
@llakala:matrix.orgllakala is there any reason to prefer isNull over x == null? 00:55:16
@tuxy01:matrix.orgtuxy joined the room.00:58:41
@bendoubleu:llyxx.meBenDoubleU joined the room.01:23:03
@lumi:the-apothecary.club@lumi:the-apothecary.club removed their profile picture.02:45:34
@lumi:the-apothecary.club@lumi:the-apothecary.club set a profile picture.03:03:14
@hsjobeki:matrix.orghsjobekidocs say it's equivalent. https://noogle.dev/f/builtins/isNull/ But I guess it's an additional lambda call performance wise. 06:00:47
@toonn:matrix.orgtoonn MattSturgeon: Yeah, that's what I thought. Still can't find a better way to get at the options for pixelfed.nginx though, there's no valueMeta containing the configuration AFAICT. 07:57:27
@koichiio:matrix.org@koichiio:matrix.org joined the room.08:21:23

Show newer messages


Back to Room ListRoom Version: 6