!SgYlXivkogarTVcnZO:nixos.org

Nix Flakes

885 Members
179 Servers

Load older messages


SenderMessageTime
23 Jun 2023
@crtified:crtified.meCRTifiedI 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 all11:38:14
@emilazy:matrix.orgemilyby mapping the /nix/store source prefixes to URLs depending on the input spec11:38:16
@emilazy:matrix.orgemilyit might be omitted for obscure evaluation caching reasons I guess11:38:44
@emilazy:matrix.orgemilythough the benefit seems marginal11:38:53
@raphi:tapesoftware.netraphi builtins.readFile ./flake.lock is probably the best you're going to get 11:51:01
@crtified:crtified.meCRTified

Wow, that might actually work?

builtins.fromJSON (builtins.readFile (self.outPath + "/flake.lock"))
11:53:27
@crtified:crtified.meCRTified

I mean:

nix-repl> :lf .
Added 15 variables.

nix-repl> test
{ nodes = { ... }; root = "root"; version = 7; }
11:53:59
@crtified:crtified.meCRTified *

Wow, that might actually work?

test = builtins.fromJSON (builtins.readFile (self.outPath + "/flake.lock"));
11:54:06
@emilazy:matrix.orgemilyoh that's utterly horrible :)11:55:46
@emilazy:matrix.orgemilyand yet so tempting11:55:49
@emilazy:matrix.orgemilythe lock doesn't have to be checked in I guess, but you could do awful stuff parsing flake.nix11:56:33
@emilazy:matrix.orgemilyyou shouldn't give me ideas like this, this is dangerous11:56:55
@crtified:crtified.meCRTified
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
@emilazy:matrix.orgemily we have builtins.toXML but no parser?? 11:58:40
@crtified:crtified.meCRTifiedtoXML is also something different11:58:47
@crtified:crtified.meCRTifiedtoXML gives you the expression representation11:58:57
@emilazy:matrix.orgemilyyeah11:59:05
@emilazy:matrix.orgemilystill11:59:07
@emilazy:matrix.orgemilyI know people use toXML to do evil stuff to get information about functions etc.11:59:19
@emilazy:matrix.orgemilybut I didn't know they were doing, like, regex XML parsing to get that back out11:59:29
@crtified:crtified.meCRTified

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:crtified.meCRTified
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:crtified.meCRTified
In reply to @emilazy:matrix.org
we have builtins.toXML but no parser??
https://github.com/NixOS/nixpkgs/issues/57239
12:02:38
@crtified:crtified.meCRTifiedhttps://github.com/kanwren/nix-parsec That might be helpful 🤔12:03:19
@crtified:crtified.meCRTifiedEspecially https://github.com/kanwren/nix-parsec/pull/612:03:43
@emilazy:matrix.orgemilyi imagine it'll be miserably slow :)12:04:07
@emilazy:matrix.orgemilybut it might be fun anyway12:04:13
@emilazy:matrix.orgemily i need to sleep, hopefully when i wake up i'll have shaken this dread curse that makes me think trying to reimplement nix's flake.nix parsing logic to poke at an unknown inputs.self is a good idea 12:05:01
@twitchy0:matrix.orgtwitchy0
In reply to @emilazy:matrix.org
you shouldn't give me ideas like this, this is dangerous
I think it's acceptable. Self is considered a flake input, and nix will put your working code in the nix store so you do still have purity in inputs.
I can maybe see danger with instability, but it seems like fair game to me to use the flake.lock
12:06:01
@twitchy0:matrix.orgtwitchy0I should say "flake is considered a flake input" only from understanding, dunno about officially12:07:29

Show newer messages


Back to Room ListRoom Version: 6