diff --git a/configs/nixos/modules/services/homepage.nix b/configs/nixos/modules/services/homepage.nix index d205f1c..d0a9960 100644 --- a/configs/nixos/modules/services/homepage.nix +++ b/configs/nixos/modules/services/homepage.nix @@ -56,12 +56,37 @@ let orderedTabs = tabOrder ++ lib.filter (tab: !lib.elem tab tabOrder) (lib.attrNames entriesByTab); + sectionOrderByTab = { + Apps = [ + "Media" + "Files" + "Other" + ]; + Download = [ + "Library Managers" + "Other Utilities" + "Download Clients" + ]; + System = [ + "Monitoring" + "Network" + "Machines" + "Docker" + ]; + }; + + orderedSections = tab: sections: + let + sectionOrder = sectionOrderByTab.${tab} or [ ]; + in + sectionOrder ++ lib.filter (section: !lib.elem section sectionOrder) (lib.attrNames sections); + mkTab = tab: let sections = entriesByTab.${tab}; in { - ${tab} = map (section: { ${section} = sections.${section}; }) (lib.attrNames sections); + ${tab} = map (section: { ${section} = sections.${section}; }) (orderedSections tab sections); }; homepageServices = map mkTab (lib.filter (tab: lib.hasAttr tab entriesByTab) orderedTabs);