| 6 Mar 2025 |
elikoga | I mean it's right there | 00:32:30 |
elikoga | In the manual | 00:32:34 |
elikoga | Search nix manual | 00:32:41 |
elikoga | Also what does this have to do with flakes | 00:33:20 |
solomon | it doensn't | 00:33:41 |
elikoga | flake-utils is a very pretty library but the function itself is not primarily related | 00:33:54 |
solomon | you showed me this code as a possible solution to a flake isuse | 00:33:58 |
elikoga | Though good question on the nix build command, since I have not found documentation for the shorthand flake attribute selector | 00:34:27 |
solomon | in any case, it didnt fix my problem | 00:35:04 |
solomon | those nested packages still arent showing up | 00:35:21 |
elikoga | Not in the root? | 00:36:20 |
elikoga | Since the tree is supposed to be flattened | 00:36:32 |
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 |