!wfudwzqQUiJYJnqfSY:nixos.org

NixOS Module System

81 Members
20 Servers

Load older messages


SenderMessageTime
23 Apr 2024
@nbp:mozilla.orgnbp djacu: Ok, I am going to be pedantic :P
listOf is not modular, thus someone who might want to extend an existing "page" would have to completely replace the template describe in one of the imported modules.
At first I will suggest using the DOM names such as firstChild, nextSibling to describe to tree of DOM elements.
09:47:16
@nbp:mozilla.orgnbp Also, one might want to use shortcuts, such as in JS with getElementById("id"), we could imagine an types.attrsOf types.submodule dom.element; where the attribute name corresponds to the id, and where the definitions are forwarded to every submodule as long as the id attribtue is equal. 09:49:30
@nbp:mozilla.orgnbp This would add tons of mkIf … but only the one with the matching identifier would be extended with the module system. 09:50:34
@nbp:mozilla.orgnbp * djacu: Ok, I am going to be pedantic :P
listOf is not modular, thus someone who might want to extend an existing "page" would have to completely replace the template describe in one of the imported modules.
At first I will suggest using the DOM names such as firstChild, nextSibling to describe the tree of DOM elements.
10:48:37
@djacu:matrix.org@djacu:matrix.org nice try nbp
you almost got me thinking seriously about about my meme project ;P
13:38:06
24 Apr 2024
@shalokshalom:kde.org@shalokshalom:kde.org joined the room.14:38:14
@redblueflame:matrix.orgredblueflame joined the room.14:40:57
@ktemkin:katesiria.org@ktemkin:katesiria.org joined the room.15:13:08
@ckie:ckie.devmei 🌒& joined the room.16:07:44
@ckie:ckie.devmei 🌒& djacu: your nix2html reminds me of my html.nix which takes a different approach 16:09:46
@ckie:ckie.devmei 🌒&it oculd be changed to output config values!16:10:04
@djacu:matrix.org@djacu:matrix.orgwoah this is neat!16:13:41
@nbp:mozilla.orgnbpThe functor idea is indeed really neat, and someday someone would figure a way to make an HTML template tool based on Nix.16:35:04
@nbp:mozilla.orgnbpI myself tried it without being convinced by my own monster :P16:35:05
@infinidoge:matrix.org@infinidoge:matrix.orgThe functor idea is a really neat use of them16:38:39
@infinidoge:matrix.org@infinidoge:matrix.orgI wish they were better documented because they are a really cool and interesting feature of the language16:38:55
@shalokshalom:kde.org@shalokshalom:kde.org We have functors :O 20:17:47
@2clayzx:matrix.org2clayzx joined the room.20:21:56
@nuko:shimeji.cafe@nuko:shimeji.cafe joined the room.21:01:45
@pxc:matrix.orgpxc

are there any libraries for writing modules designed to work across module systems? Is there any kind of way to introspect what kind of module system is consuming a module?

i.e., I'd like to be able to do like mkIf <this is being used in Nix-Darwin> ... and mkIf <this is being used in Home Manager ..., etc.

21:38:48
@pxc:matrix.orgpxc

(obviously, where interfaces are compatible, you can have some modules imported in various different module systems and just werk; I do this with nix.settings stuff in my personal Nix configs for HM, NixOS, and Nix-Darwin)

I'm wondering what projects have explored/attempted this the most

21:39:54
@pxc:matrix.orgpxcI think nixvim might do some of this but it's not what I would consider a simple example21:40:39
25 Apr 2024
@lychee:lefishe.club@lychee:lefishe.club joined the room.06:45:38
@nbp:mozilla.orgnbp pxc: mkSinkUndeclaredOptions can be used to fake option declarations for such cases. If such interopperable module exists, they might define option for some module set and not others.
If any such library exists, they would likely make use of this option declaration function as a mean to make generic modules work across module-sets.
09:48:27
@nbp:mozilla.orgnbp * pxc: mkSinkUndeclaredOptions can be used to fake option declarations for such cases. If such interopperable module exists, they might define option for some module set which are not in others.
If any such library exists, they would likely make use of this option declaration function as a mean to make generic modules work across module-sets.
09:48:54
@nbp:mozilla.orgnbp * pxc: If such interoperable module exists, they might define option for some module set which are not in others. mkSinkUndeclaredOptions can be used to fake the interface (option declarations) of other module sets. 09:51:50
@stablejoy:matrix.orgstablejoy joined the room.12:15:07
@pxc:matrix.orgpxc
In reply to @nbp:mozilla.org
pxc: If such interoperable module exists, they might define option for some module set which are not in others. mkSinkUndeclaredOptions can be used to fake the interface (option declarations) of other module sets.
thank you for the tip!
14:56:38
@adam:robins.wtf@adam:robins.wtf left the room.19:30:54
@ss:someonex.netSomeoneSerge (utc+3) changed their display name from SomeoneSerge (void) to SomeoneSerge (UTC+1).23:01:27

Show newer messages


Back to Room ListRoom Version: 10