Sender | Message | Time |
---|---|---|
30 Jul 2024 | ||
quapka4 | * Hi folks, let's say I am building a derivation that depends on many pkgs and I wanna be able to build the final derivation with various versions of the dependencies. What is a clean way to do it? I was thinking something like:
| 09:08:48 |
quapka4 | And then if version of a given package is provided I will rebuild it. | 09:09:09 |
raf changed their display name from notashelf to raf. | 10:04:55 | |
raf changed their display name from raf to NotAShelf. | 10:05:49 | |
Matt Sturgeon | Normally you would do this using the When you call your derivation using
| 10:26:26 |
Matt Sturgeon | * Normally you would do this using the When you call your derivation using
| 10:27:04 |
Matt Sturgeon | * Normally you would do this using the When you call your derivation using
| 10:28:00 |
Zm94ZGV2 changed their profile picture. | 10:33:26 | |
quapka4 | Thanks! | 10:43:56 |
quapka4 | Hm, inherit name.value to inherit value as value does not work? Is there a reason or different syntax needed? Would such a use case make sense? | 11:31:51 |
LordMZTE | You want inherit (name) value; here. I think this is in place so you can inherit multiple values without it looking strange. you could have inherit (name) value otherValue; for example. | 11:43:01 |
quapka4 | Can I do that for multiple values? Say I have
| 11:52:00 |
quapka4 | I tried:
But can't get it to work. | 11:53:02 |
LordMZTE | The third one should work. Can you show the error you're getting? | 11:54:13 |
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 |