Sender | Message | Time |
---|---|---|
19 Apr 2024 | ||
hexa | infinisil: https://github.com/NixOS/nixpkgs/pull/305334#issuecomment-2067069655 can you answer this? | 18:44:37 |
infinisil | In reply to @hexa:lossy.network☑️ | 18:50:31 |
hexa | thansk! | 18:50:36 |
hexa | * thanks! | 18:50:41 |
22 Apr 2024 | ||
@djacu:matrix.org | Is there a way I can circumvent the Two attributes I've implemented so far are Trying to think of a good solution but coming up empty. Any ideas? | 06:19:34 |
@infinidoge:matrix.org | You probably want either the anything option type, or to define your own types | 08:29:40 |
nbp | Why using submodules if you have only a single instance of each attribute? | 10:28:26 |
nbp | You can declare options to be unused: https://github.com/NixOS/nixpkgs/blob/8e54038847aa80ee2b1ffa9e313b0ab918f1903c/lib/options.nix#L228-L244 But I do not think this answer your problem. One example of usage of it is from this PR: https://github.com/NixOS/nixpkgs/pull/152785/files | 10:36:38 |
nbp | Maybe you can use the type nullOr and have a default value of null . | 10:37:54 |
nbp | mkDefault should be delayed, like mkIf , so mapAttrs (name: mkDefault) should be replaceable by mkDefault .https://github.com/NixOS/nixpkgs/blob/master/lib/modules.nix#L882 | 12:24:56 |
infinisil | nbp Nah that's not the same. The former will merge attrs with the default priority, while the latter will override it completely | 12:27:38 |
@djacu:matrix.org | nbp: The reason for using submodules is because html attributes can be used in different html elements. So I want a reusable piece of code. The other reason is that I can define how html attributes are called in a standard way using the I think I got something working using | 15:45:13 |
@djacu:matrix.org | Related but different question. I had trouble accessing the For example, I define an option At the top level, I can access | 15:49:55 |
nbp | isDefined should not be used most of the time, as this is kind of an internal aspect, and it can only be used within the module itself.Adding an options argument attribute to the submodule would let you query the option tree of the submodule. | 16:06:40 |
@djacu:matrix.org | In reply to @nbp:mozilla.orgYeah that's how I was doing it; defining the option argument in the submodule. | 16:07:56 |
nbp | There is no way to get the option declaration out of a submodule, at least not without changing the submodule type. | 16:09:35 |
23 Apr 2024 | ||
@djacu:matrix.org | Alright I've done something extremely silly and cursed. https://github.com/djacu/nix2html also featuring the new It's barely got any html elements or attributes so far so don't expect the world. | 05:15:23 |
@infinidoge:matrix.org | Finally, we can subsume the entire internet into pure Nix | 05:16:01 |
nbp | djacu: Ok, I am going to be pedantic :PlistOf 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 | 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 | 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 | * djacu: Ok, I am going to be pedantic :PlistOf 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 | nice try nbp you almost got me thinking seriously about about my meme project ;P | 13:38:06 |
24 Apr 2024 | ||
@shalokshalom:kde.org joined the room. | 14:38:14 | |
redblueflame joined the room. | 14:40:57 | |
@ktemkin:katesiria.org joined the room. | 15:13:08 | |
mei 🌒& joined the room. | 16:07:44 | |
mei 🌒& | djacu: your nix2html reminds me of my html.nix which takes a different approach | 16:09:46 |
mei 🌒& | it oculd be changed to output config values! | 16:10:04 |
@djacu:matrix.org | woah this is neat! | 16:13:41 |