| 11 Oct 2023 |
@piegames:matrix.org | On the other hand, shouldn't this still work as long as the package set doesn't define a callPackage? Because stuff is lazy etc. | 14:43:28 |
@piegames:matrix.org | Well, attribute names are not, but still | 14:43:39 |
infinisil | Actually lazy attribute sets would allow this: https://github.com/NixOS/nix/issues/4090 | 14:43:59 |
infinisil | piegames: It can't now whether it defines a callPackage without evaluating it | 14:44:25 |
tomberek | lazy attrsets... lazy attsets ... lazy attrsets. Or __getter (https://github.com/NixOS/nix/issues/8187#issuecomment-1501258036) or builtins.mkProxy..... or something | 14:45:43 |
@piegames:matrix.org | Hm, are there any other ways to solve my current problem? | 14:45:53 |
@piegames:matrix.org | How does by-name work around this? | 14:46:01 |
@piegames:matrix.org | While I do approve of the function-as-attrset idea, I have a very strong aversion towards underscoreunderscore magic attribute names, and generally want to see less of them in the language | 14:47:29 |
infinisil | piegames: The attribute names of pkgs/by-name don't depend on final, they're only computed using lib | 15:28:58 |
infinisil | See https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/by-name-overlay.nix | 15:29:17 |
@piegames:matrix.org | but it does self.callPackage? | 15:30:10 |
infinisil | piegames: It doesn't need that to compute the attribute names though | 15:31:47 |
infinisil | It's only the attribute values defined using callPackage, which is the same as all-packages.nix | 15:32:15 |
tomberek | making it a builtin is another way to do it | 15:33:07 |
@piegames:matrix.org | But what is one puts some by-name/callPackage in there? (hypothetically) | 15:34:39 |
infinisil | piegames: The order of overlays would determine which one gets the final (hah) say: https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/stage.nix#L284-L295 | 15:37:49 |