fix(nixos): order homepage sections

This commit is contained in:
2026-09-15 20:01:59 -04:00
parent 550ebc1a26
commit 2d50571fa2

View File

@@ -56,12 +56,37 @@ let
orderedTabs = tabOrder ++ lib.filter (tab: !lib.elem tab tabOrder) (lib.attrNames entriesByTab); 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: mkTab = tab:
let let
sections = entriesByTab.${tab}; sections = entriesByTab.${tab};
in 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); homepageServices = map mkTab (lib.filter (tab: lib.hasAttr tab entriesByTab) orderedTabs);