| 21 Jun 2023 |
@antifuchs:asf.computer | it's in the original repo | 17:51:18 |
@adam:valkor.net | what if you use the actual branch name? | 17:52:03 |
@antifuchs:asf.computer | but good call - maybe there's a way to find the branch of the PR? I'm trying to determine that in a hydra jobset derivation, and my understanding of how to go from one bit of information to the other is ... lacking | 17:52:18 |
@antifuchs:asf.computer | (as are the docs, tbqh) | 17:52:22 |
@antifuchs:asf.computer | ahhh, I think I see how to get at the branch name. this might work! | 17:54:57 |
@antifuchs:asf.computer | perfect, hydra gets the entire pull request API response, so I can easily use info.head.ref as the branch ref. thanks for the help (: | 17:58:20 |
@adam:valkor.net | you're welcome. :) | 18:26:27 |
| @alx_sim:matrix.org joined the room. | 19:43:08 |
| 23 Jun 2023 |
| peacememories (Old) left the room. | 07:30:47 |
| peacememories (Old) joined the room. | 07:31:03 |
emily | is there any way to get information on the input declaration of a flake input from the input values passed to outputs? | 11:27:36 |
emily | e.g. the type (github etc.) and repo | 11:27:44 |
emily | it seems like there might not be? | 11:27:53 |
kenji | Doesn't nix flake metadata show that? | 11:29:51 |
emily | I want to access it from inside Nix code | 11:30:14 |
kenji | Ah! | 11:30:57 |
CRTified | In reply to @emilazy:matrix.org it seems like there might not be? Only thing I can find ad hoc is the sourceInfo and _type attributes | 11:34:14 |
CRTified | but they're different for e.g. non-flake inputs | 11:34:39 |
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 |