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).
This commit is contained in:
parent
bdf226d5f7
commit
a9cf2109a6
7 changed files with 127 additions and 55 deletions
|
@ -1,60 +1,32 @@
|
|||
{ config }:
|
||||
{ config, lib }:
|
||||
|
||||
[
|
||||
{
|
||||
"Media" = [
|
||||
{
|
||||
"Jellyfin" = {
|
||||
href = "https://jellyfin.oliverdavies.uk";
|
||||
icon = "jellyfin";
|
||||
description = "The Free Software Media System";
|
||||
siteMonitor = "http://localhost:8096";
|
||||
};
|
||||
}
|
||||
with lib;
|
||||
|
||||
{
|
||||
"Immich" = {
|
||||
href = "https://photos.oliverdavies.uk";
|
||||
icon = "immich";
|
||||
description = "Self-hosted photo and video management solution";
|
||||
siteMonitor = "http://localhost:${toString config.services.immich.port}";
|
||||
};
|
||||
}
|
||||
let
|
||||
homelab = config.features.homelab.services;
|
||||
|
||||
{
|
||||
"Audiobookshelf" = {
|
||||
href = "https://audiobookshelf.oliverdavies.uk";
|
||||
icon = "audiobookshelf";
|
||||
description = "Self-hosted audiobook and podcast server";
|
||||
siteMonitor = "http://localhost:4001";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
homepageCategories = [
|
||||
"Media"
|
||||
"Services"
|
||||
];
|
||||
|
||||
{
|
||||
"Services" = [
|
||||
{
|
||||
"Uptime Kuma" = {
|
||||
description = "A fancy self-hosted monitoring tool";
|
||||
href = "https://uptime.oliverdavies.uk";
|
||||
icon = "uptime-kuma";
|
||||
siteMonitor = "http://localhost:${toString config.services.uptime-kuma.settings.PORT}";
|
||||
};
|
||||
}
|
||||
homepageServices =
|
||||
category:
|
||||
(attrsets.filterAttrs (
|
||||
name: value: value ? homepage && value.homepage.category == category
|
||||
) homelab);
|
||||
|
||||
{
|
||||
"Paperless-ngx" =
|
||||
let
|
||||
cfg = config.services.paperless;
|
||||
in
|
||||
{
|
||||
description = "Document management system";
|
||||
href = cfg.settings.PAPERLESS_URL;
|
||||
icon = "paperless";
|
||||
siteMonitor = "http://localhost:${toString cfg.port}";
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue