| 23 Jun 2023 |
CRTified | (non-flake has neither of them, but rev and shortRev instead) | 11:35:14 |
emily | yeah, unfortunately it seems like sourceInfo doesn't really include... source info | 11:37:31 |
emily | I was hoping it'd be possible to intelligently link to sources of module option definitions in manuals | 11:38:01 |
CRTified | I originally wanted to make the argument that remotes could be considered impure, but then I noticed that the URL is given in the flake, so at that point not impure at all | 11:38:14 |
emily | by mapping the /nix/store source prefixes to URLs depending on the input spec | 11:38:16 |
emily | it might be omitted for obscure evaluation caching reasons I guess | 11:38:44 |
emily | though the benefit seems marginal | 11:38:53 |
raphi | builtins.readFile ./flake.lock is probably the best you're going to get | 11:51:01 |
CRTified | Wow, that might actually work?
builtins.fromJSON (builtins.readFile (self.outPath + "/flake.lock"))
| 11:53:27 |
CRTified | I mean:
nix-repl> :lf .
Added 15 variables.
nix-repl> test
{ nodes = { ... }; root = "root"; version = 7; }
| 11:53:59 |
CRTified | * Wow, that might actually work?
test = builtins.fromJSON (builtins.readFile (self.outPath + "/flake.lock"));
| 11:54:06 |
emily | oh that's utterly horrible :) | 11:55:46 |
emily | and yet so tempting | 11:55:49 |
emily | the lock doesn't have to be checked in I guess, but you could do awful stuff parsing flake.nix | 11:56:33 |
emily | you shouldn't give me ideas like this, this is dangerous | 11:56:55 |
CRTified | In reply to @emilazy:matrix.org you shouldn't give me ideas like this, this is dangerous I'm still thinking about whether I should write an XML parser in nix, sooo I'm not the one to not give stupid ideas... 😄 | 11:57:57 |
emily | we have builtins.toXML but no parser?? | 11:58:40 |
CRTified | toXML is also something different | 11:58:47 |
CRTified | toXML gives you the expression representation | 11:58:57 |
emily | yeah | 11:59:05 |
emily | still | 11:59:07 |
emily | I know people use toXML to do evil stuff to get information about functions etc. | 11:59:19 |
emily | but I didn't know they were doing, like, regex XML parsing to get that back out | 11:59:29 |
CRTified | And I was asked by a friend whether I could write some "arbitrary XML generation" 😄 https://github.com/CRTified/nixml
And since then, I'm thinking about whether I should write a parser, and maybe write an XSD parser to have some xsdToOptions function 🥲
| 12:00:04 |
CRTified | In reply to @emilazy:matrix.org but I didn't know they were doing, like, regex XML parsing to get that back out I mean, maybe there's some parser already out there | 12:01:29 |
CRTified | In reply to @emilazy:matrix.org we have builtins.toXML but no parser?? https://github.com/NixOS/nixpkgs/issues/57239 | 12:02:38 |
CRTified | https://github.com/kanwren/nix-parsec That might be helpful 🤔 | 12:03:19 |
CRTified | Especially https://github.com/kanwren/nix-parsec/pull/6 | 12:03:43 |
emily | i imagine it'll be miserably slow :) | 12:04:07 |
emily | but it might be fun anyway | 12:04:13 |