2025-04-30 11:58:59 +01:00
|
|
|
{ config, lib }:
|
2025-04-28 00:36:43 +01:00
|
|
|
|
2025-04-30 11:58:59 +01:00
|
|
|
with lib;
|
2025-04-28 00:53:26 +01:00
|
|
|
|
2025-04-30 11:58:59 +01:00
|
|
|
let
|
|
|
|
homelab = config.features.homelab.services;
|
2025-04-28 01:58:11 +01:00
|
|
|
|
2025-04-30 11:58:59 +01:00
|
|
|
homepageCategories = [
|
|
|
|
"Media"
|
|
|
|
"Services"
|
|
|
|
];
|
2025-04-28 00:26:30 +01:00
|
|
|
|
2025-04-30 11:58:59 +01:00
|
|
|
homepageServices =
|
|
|
|
category:
|
|
|
|
(attrsets.filterAttrs (
|
|
|
|
name: value: value ? homepage && value.homepage.category == category
|
|
|
|
) homelab);
|
2025-04-28 21:26:56 +01:00
|
|
|
|
2025-04-30 11:58:59 +01:00
|
|
|
services = lists.forEach homepageCategories (cat: {
|
|
|
|
"${cat}" =
|
|
|
|
lib.lists.forEach (lib.attrsets.mapAttrsToList (name: value: name) (homepageServices "${cat}"))
|
|
|
|
(x: {
|
|
|
|
"${homelab.${x}.homepage.name}" = {
|
|
|
|
icon = homelab.${x}.homepage.icon;
|
|
|
|
description = homelab.${x}.homepage.description;
|
|
|
|
href = "https://${homelab.${x}.url}";
|
|
|
|
siteMonitor = "https://${homelab.${x}.url}";
|
2025-04-28 00:36:43 +01:00
|
|
|
};
|
2025-04-30 11:58:59 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
in
|
2025-04-30 13:42:51 +01:00
|
|
|
services ++ [ (import ./glances.nix { inherit config; }) ]
|