Sender | Message | Time |
---|---|---|
30 Jul 2024 | ||
quapka4 | Oh, I am so sorry, it does indeed! I have messed with the pkgBuilder and removed hash and didn't read the subsequent error msg properly. Thanks. | 11:55:51 |
Zm94ZGV2 changed their profile picture. | 13:02:00 | |
Zm94ZGV2 changed their profile picture. | 13:04:57 | |
Zm94ZGV2 changed their profile picture. | 13:06:30 | |
quapka4 | Is there a way to encode function call in JSON so that
| 14:23:58 |
@quasigod:matrix.org left the room. | 15:08:00 | |
remi-gelinas | Why not just put that in a nix file and import it? | 16:00:27 |
Matt Sturgeon | The problem here is that you are using part of This is recursive, and because You can either use | 16:36:01 |
infinisil | remi-gelinas: I'd guess because it's something e.g. auto-generated, or the JSON comes from an external source, etc. | 20:51:28 |
infinisil | In reply to @quapka4:matrix.orgGenerally the answer is to have a Nix file that reads and transforms the JSON into what you need, e.g. lib.mapAttrs (name: value: functionCall value) (builtins.fromJSON (builtins.readFile ./foo.json)) | 20:52:14 |
infinisil | In reply to @quapka4:matrix.org* Generally the solution is to have a Nix file that reads and transforms the JSON into what you need, e.g. lib.mapAttrs (name: value: functionCall value) (builtins.fromJSON (builtins.readFile ./foo.json)) | 20:52:24 |
infinisil | But the answer to your question of whether it's possible to encode a function in JSON is definitely No :) | 20:52:43 |
infinisil | * Generally you'll want to have a Nix file that reads and transforms the JSON into what you need, e.g. lib.mapAttrs (name: value: functionCall value) (builtins.fromJSON (builtins.readFile ./foo.json)) | 20:53:00 |
Matt Sturgeon | * Normally you would do this using the When you call your derivation using
| 21:12:03 |
31 Jul 2024 | ||
xavierlauzon joined the room. | 02:27:55 | |
quapka4 | In reply to @infinisil:matrix.orgI see, thanks. As you have guessed correctly, I am automatically generating "the JSON" from Python. For now, I settled on using Jinja2 template to directly generate Nix files. | 10:08:44 |
quapka4 | Somewhat related, when I output many packages (those auto-generated), can I force
And then have | 10:12:49 |
quapka4 | In reply to @infinisil:matrix.orgI haven't thought about the mapping, that is interesting, I'll see if that would make sense. | 10:14:52 |
quapka4 | In reply to @quapka4:matrix.orgSimply, specify the level of the printed trees. | 10:19:57 |
quapka4 | Also, are there Python bindings to write/read Nix files? | 10:41:22 |
Tranquil Ity | In reply to @quapka4:matrix.orgWhat do you mean by write/read Nix files? Like a parser to spit out an AST? | 10:45:44 |
Tranquil Ity | * What do you mean by write/read Nix files? Like a parser to spit out an AST as objects? | 10:45:59 |
quapka4 | Yes, something like BeautifulSoup for HTML, but for Nix files. | 10:47:02 |
Tranquil Ity | Well, HTML is a markup language while Nix is a programming language. All I can find is https://github.com/nix-community/rnix-parser in Rust, you can probably bind it to Python in some way. | 11:04:25 |
quapka4 | In reply to @ity:itycodes.orgNice, thanks. | 11:10:39 |
cynerd left the room. | 11:53:02 | |
cynerd joined the room. | 11:53:50 | |
@thalos:jupiterbroadcasting.com left the room. | 17:34:56 | |
1 Aug 2024 | ||
@ibtalot:matrix.org left the room. | 04:50:08 | |
@thescientiac:matrix.org left the room. | 05:15:58 |