| 8 Jun 2021 |
| davidtwco joined the room. | 10:01:35 |
| Artturin joined the room. | 17:24:10 |
emily | Buckley: no, but you can do e.g. pipe x [ f g h ] for f (g (h x)) | 21:17:48 |
emily | still need parens if f, g or h are themselves function applications (e.g. for passing multiple arguments) | 21:17:59 |
emily | er, that's lib.pipe from nixpkgs rather | 21:18:04 |
Buckley | hmm, thats one to remember | 21:18:58 |
| 9 Jun 2021 |
| chrisawcom joined the room. | 13:50:26 |
toonn | That order of application is a little unintuitive, no? | 16:49:00 |
toonn | I'd expect that order for something named "compose." | 16:49:11 |
toonn | But pipe suggests shell pipes, going front to back. | 16:49:33 |
aaronjanse | I think that's what it does do? | 16:57:06 |
aaronjanse | At least if you think of x as an initial command to generate data (such as cat some/file/path) | 16:57:37 |
aaronjanse | Oh wait nvm, I see | 16:58:03 |
sterni | nix-repl> lib.pipe 12 [ (a: a + 12) (lib.const "lol") ]
"lol"
yep
| 16:58:06 |
sterni | the expansion emily did had the wrong order h should have been the outermost call | 16:58:32 |
sterni | * the expansion emily did had the wrong order, h should have been the outermost call | 16:58:57 |
emily | whoops, yes, sorry | 17:03:16 |
emily | the value coming first is definitely the weirdest thing :| | 17:03:47 |
emily | there's a comment right below it like "don't change this to have an order that would be useful, it'd be confusing" | 17:04:02 |
sterni | haha | 17:04:23 |
lunik1 | It's there a way to merge two attribute sets in the same manner as modules? | 20:18:19 |
sterni | lunik1: it just uses // https://github.com/NixOS/nixpkgs/blob/83f6711464e03a856fb554693fe2e0f3af2ab0d5/lib/types.nix#L326-L332 | 20:20:41 |
sterni | okay, options are merged differently though | 20:21:01 |
sterni | you can just use the appropriate parts of lib/ probably | 20:21:27 |
lunik1 | yeah I mean options | 20:21:31 |
lunik1 | I think mkMerge has something to do with what I need, but I'm not quite sure what do do with the object it gives me... | 21:04:44 |
| 10 Jun 2021 |
| Church joined the room. | 04:29:38 |
Buckley | a module can be
{ lib, ... }:{ config = lib.mkMerge [ ]; }
| 05:26:44 |
Buckley | and then you just add your sets into the list | 05:27:02 |
Buckley | lunik1: ^ | 05:27:56 |