nix-config/hosts/nixedo/services/homepage/services.nix
Oliver Davies a9cf2109a6 Move Homepage configuration into service
Move each service's Homepage Dashboard configuration into its own
module.

Based on
8928785060/homelab/services/homepage/default.nix.

See https://www.youtube.com/watch?v=f-x5cB6qCzA&t=1435s (What's on my
Home Server 2025 – NixOS Edition).
2025-04-30 11:58:59 +01:00

32 lines
782 B
Nix

{ config, lib }:
with lib;
let
homelab = config.features.homelab.services;
homepageCategories = [
"Media"
"Services"
];
homepageServices =
category:
(attrsets.filterAttrs (
name: value: value ? homepage && value.homepage.category == category
) homelab);
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}";
};
});
});
in
services