| 6 Mar 2025 |
solomon | I thought flake-utils' flattenTree would do this but it doesnt seem to | 00:18:23 |
solomon | * I thought flake-utils' flattenTree would allow this but it doesnt seem to | 00:18:30 |
elikoga | I think you can place them in the root of the flake outputs | 00:19:01 |
solomon | what do you mean? | 00:19:16 |
elikoga | Right now you're trying to use shorthand package selection syntax but it probably fails due to there not being an architecture | 00:19:27 |
solomon | sorry let me give a real example:
packages = flake-utils.lib.flattenTree {
docker = import ./nix/docker.nix {
inherit pkgs;
cofree-bot = hsPkgs.cofree-bot;
};
ghc982 = flake-utils.lib.flattenTree {
chat-bots = hsPkgs.chat-bots;
chat-bots-contrib = hsPkgs.chat-bots-contrib;
cofree-bot = hsPkgs.cofree-bot;
default = hsPkgs.cofree-bot;
};
chat-bots = hsPkgs.chat-bots;
chat-bots-contrib = hsPkgs.chat-bots-contrib;
cofree-bot = hsPkgs.cofree-bot;
default = hsPkgs.cofree-bot;
};
| 00:19:52 |
solomon | * sorry let me give a real example:
packages = flake-utils.lib.flattenTree {
docker = import ./nix/docker.nix {
inherit pkgs;
cofree-bot = hsPkgs.cofree-bot;
};
ghc982 = {
chat-bots = hsPkgs.chat-bots;
chat-bots-contrib = hsPkgs.chat-bots-contrib;
cofree-bot = hsPkgs.cofree-bot;
default = hsPkgs.cofree-bot;
};
chat-bots = hsPkgs.chat-bots;
chat-bots-contrib = hsPkgs.chat-bots-contrib;
cofree-bot = hsPkgs.cofree-bot;
default = hsPkgs.cofree-bot;
};
| 00:20:02 |
solomon | and i'm using flake-utils.lib.eachDefaultSystem | 00:20:22 |
solomon | * and i'm using flake-utils.lib.eachDefaultSystem to set the architecture | 00:20:56 |
elikoga | Ah, yes, I'm not familiar with flattenTree but you can try using tab completion in the cli or nix repl to find out the ultimate path of your packages. And then use them | 00:21:12 |
solomon | i did that and those nested packages dont show up at all | 00:21:26 |
elikoga | I suggest reading library source code if you are not familiar with the behavior of a library | 00:21:44 |
elikoga |  Download Screenshot_20250306_012226_Firefox.png | 00:22:40 |
elikoga | Have you tried setting recurseForDerivations? | 00:22:56 |
elikoga | https://github.com/numtide/flake-utils/blob/11707dc2f618dd54ca8739b309ec4fc024de578b/flattenTree.nix#L18 | 00:23:09 |
solomon | i've never heard of that | 00:23:11 |
elikoga | I don't know it's right there on my screen | 00:23:22 |
solomon | uh where do i set it? | 00:23:54 |
elikoga | Where you want to recurse for derivations | 00:24:13 |
solomon | i dont understand where it is bound in the code | 00:24:44 |
solomon | it looks like a free variable | 00:25:02 |
elikoga | Can you try placing it where it would seem useful? | 00:25:25 |
solomon | wtf | 00:25:31 |
solomon | were looking at a pure functon that references a variable recurseForDerivations without binding it | 00:26:03 |
solomon | i have no idea what to set it | 00:26:07 |
solomon | * i have no idea where to set it | 00:26:20 |
elikoga | I believe that placing it in the root as well as sub attrs up until the value you want to expose should work | 00:26:23 |
solomon | i dont understand what that means | 00:26:35 |
solomon | can you give an example? | 00:26:53 |
elikoga | Okay I will use rFD as shorthand since I'm on my phone | 00:27:17 |