{ extensions, userChrome, extraConfig, bookmarks, search, lib, ... }: let hexLib = import ./lib.nix {inherit lib;}; mkProject = project: subproject: if builtins.isString subproject then { name = "${project.name}.${subproject}"; prefix = null; } else let name = builtins.elemAt (builtins.attrNames subproject) 0; in { name = "${project.name}.${name}"; subprojects = builtins.elemAt (builtins.attrValues subproject) 0; prefix = null; }; mkProjectName = project: if builtins.hasAttr "subprojects" project then lib.lists.flatten ([project.name] ++ (builtins.map mkProjectName (builtins.map (mkProject project) project.subprojects))) else [project.name]; projects = lib.lists.flatten (builtins.map mkProjectName (import ../projects {})); mkFirefoxProfile = { name, id, }: { inherit name; value = { isDefault = false; inherit name id extensions userChrome search bookmarks extraConfig; }; }; projects_id = builtins.map (project: { name = project; id = hexLib.fromHexString (builtins.hashString "sha256" project); }) projects; firefoxProfiles = builtins.listToAttrs (builtins.map mkFirefoxProfile projects_id); in firefoxProfiles