| 6 Mar 2025 |
solomon | packages = flake-utils.lib.flattenTree {
recurseForDerivations = true;
docker = import ./nix/docker.nix {
inherit pkgs;
cofree-bot = hsPkgs.cofree-bot;
};
ghc982 = flake-utils.lib.flattenTree {
recurseForDerivations = true;
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:36:36 |
solomon | nix-repl> outputs.packages.x86_64-linux.
outputs.packages.x86_64-linux.chat-bots outputs.packages.x86_64-linux.cofree-bot outputs.packages.x86_64-linux.docker
outputs.packages.x86_64-linux.chat-bots-contrib outputs.packages.x86_64-linux.default
| 00:36:54 |
elikoga | I'm gonna stroke | 00:37:14 |
solomon | lol | 00:37:21 |
elikoga | I'm going to my laptop | 00:37:25 |
elikoga | While I'm booting think about the word "flat" | 00:38:44 |
solomon | okay so the example from the flake-utils repo doesn't work as they demonstrate | 00:42:04 |
solomon | flattenTree { hello = pkgs.hello; gitAndTools = pkgs.gitAndTools }
| 00:42:14 |
solomon | {
hello = «derivation»;
"gitAndTools/git" = «derivation»;
"gitAndTools/hub" = «derivation»;
# ...
}
| 00:42:21 |
solomon | thats from their docs | 00:42:26 |
solomon | nix-repl> inputs.flake-utils.lib.flattenTree { hello = pkgs.hello; gitAndTools = pkgs.gitAndTools; }
{
hello = «derivation /nix/store/aqgjk960qhww2m8hrhm6k3yacakqk7b1-hello-2.12.1.drv»;
}
| 00:42:37 |
solomon | * This is what it actually does:
nix-repl> inputs.flake-utils.lib.flattenTree { hello = pkgs.hello; gitAndTools = pkgs.gitAndTools; }
{
hello = «derivation /nix/store/aqgjk960qhww2m8hrhm6k3yacakqk7b1-hello-2.12.1.drv»;
}
| 00:42:43 |
elikoga | {
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { self, nixpkgs, flake-utils }: let
d = n: derivation { name = "hello${n}"; builder = "echo"; args = [ n ]; system = "x86_64-linux"; };
in {
packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;
packages.x86_64-linux.default = self.packages.x86_64-linux.hello;
skibidi1 = flake-utils.lib.flattenTree {
toilet1 = d "1";
toilet2 = d "2";
toilet3 = {
toilet1 = d "3";
toilet3 = d "4";
toilet4 = d "5";
toilet5 = d "6";
};
toilet4 = d "7";
toilet5 = d "8";
};
skibidi2 = flake-utils.lib.flattenTree {
toilet1 = d "1";
toilet2 = d "2";
toilet3 = {
recurseForDerivations = true;
toilet1 = d "3";
toilet3 = d "4";
toilet4 = d "5";
toilet5 = d "6";
};
toilet4 = d "7";
toilet5 = d "8";
};
};
}
Gives
nix-repl> :lf .
Added 11 variables.
nix-repl> skibidi1
{
toilet1 = «derivation /nix/store/vma0pz0q06k0mxyrg4hbnmjrk7fqlrcw-hello1.drv»;
toilet2 = «derivation /nix/store/d3rqwjknbxdfsqnn55pnj1ir988ia6r0-hello2.drv»;
toilet4 = «derivation /nix/store/6kw5bjn680zny7qrax8mjpc8p8019kyi-hello7.drv»;
toilet5 = «derivation /nix/store/dyd47yhwwwxzx3vbdcnfzczynjq1yd83-hello8.drv»;
}
nix-repl> skibidi2
{
toilet1 = «derivation /nix/store/vma0pz0q06k0mxyrg4hbnmjrk7fqlrcw-hello1.drv»;
toilet2 = «derivation /nix/store/d3rqwjknbxdfsqnn55pnj1ir988ia6r0-hello2.drv»;
"toilet3/toilet1" = «derivation /nix/store/rvj79yklvb1yvvc5x748c2c89fqkwmxm-hello3.drv»;
"toilet3/toilet3" = «derivation /nix/store/h04w672r5nnjlqhmzhsmcm0c7qw5s91m-hello4.drv»;
"toilet3/toilet4" = «derivation /nix/store/szplpw5hvljsb3yx9fpdr7sa22kv177p-hello5.drv»;
"toilet3/toilet5" = «derivation /nix/store/9pspjn694djk808nr087y86wd1a05743-hello6.drv»;
toilet4 = «derivation /nix/store/6kw5bjn680zny7qrax8mjpc8p8019kyi-hello7.drv»;
toilet5 = «derivation /nix/store/dyd47yhwwwxzx3vbdcnfzczynjq1yd83-hello8.drv»;
}
Does that help?
| 00:45:44 |
solomon | huh i dont see whats different in your example | 00:47:09 |
solomon | oh i was calling flattenTree at each level | 00:48:15 |
elikoga |  Download image.png | 00:48:25 |
elikoga | Sure doesn't look like a derivation to me | 00:48:31 |
solomon | it doesn't include the gitAndTools package as they claim it should | 00:48:59 |
solomon | * it doesn't include the gitAndTools packages as they claim it should | 00:49:05 |
elikoga | Maybe someone deactivated recurseForDerivations in upstream | 00:49:25 |
solomon | yeah idk but your example helped me, thank you | 00:49:48 |
elikoga |  Download image.png | 00:50:51 |
elikoga | Redacted or Malformed Event | 00:50:56 |
solomon | images aren't showing up for me btw | 00:51:06 |
elikoga | From the https://github.com/numtide/flake-utils readme: Go to that #numtide or whatever channel for support | 00:51:50 |
elikoga | Or at least read and understand a library function before you use it? | 00:53:22 |
elikoga | It could install a dangerous malware that would steal all your banking information and send it to north korea | 00:53:44 |
elikoga | Or after you use it and it doesn't do what you expect | 00:55:29 |
solomon | you're right i should have put more work in upfront to understand how that function worked | 01:47:13 |
| alarsyo joined the room. | 02:33:12 |