{ unstable_pkgs, stable_pkgs, extra_lib, }: let inherit (unstable_pkgs) lib; mergePkgs = pkgs: lib.callPackageWith (extra_lib.warnMerge pkgs in_tree_pkgs "the ./pkgs/by-name set"); callPackageStable = lib.callPackageWith (mergePkgs stable_pkgs); callPackageUnstable = lib.callPackageWith (mergePkgs unstable_pkgs); in_tree_pkgs = extra_lib.mkByName { baseDirectory = ./by-name; fileName = "package.nix"; finalizeFunction = name: value: if value.stable then callPackageStable value.pkg {} else callPackageUnstable value.pkg {}; }; in in_tree_pkgs