manatee: Add ability to specify public url for homepage card

This commit is contained in:
Alexander Heldt
2026-07-09 20:33:22 +02:00
parent ff02728d82
commit aa7ef695f4
+12 -2
View File
@@ -9,8 +9,13 @@ let
nginxEnabled = config.mod.nginx.enable; nginxEnabled = config.mod.nginx.enable;
services = config.mod.homepage.services; services = config.mod.homepage.services;
serviceToCard = svc: '' serviceToCard =
<a class="card" href="http://manatee:${toString svc.port}"> svc:
let
href = if svc.url != null then svc.url else "http://manatee:${toString svc.port}";
in
''
<a class="card" href="${href}">
<div class="name">${svc.name}</div> <div class="name">${svc.name}</div>
<div class="desc">${svc.description}</div> <div class="desc">${svc.description}</div>
<div class="port">:${toString svc.port}</div> <div class="port">:${toString svc.port}</div>
@@ -83,6 +88,11 @@ in
name = lib.mkOption { type = lib.types.str; }; name = lib.mkOption { type = lib.types.str; };
port = lib.mkOption { type = lib.types.port; }; port = lib.mkOption { type = lib.types.port; };
description = lib.mkOption { type = lib.types.str; }; description = lib.mkOption { type = lib.types.str; };
url = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "Link target for the card; defaults to http://manatee:<port>.";
};
}; };
} }
); );