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
+17 -7
View File
@@ -9,13 +9,18 @@ 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:
<div class="name">${svc.name}</div> let
<div class="desc">${svc.description}</div> href = if svc.url != null then svc.url else "http://manatee:${toString svc.port}";
<div class="port">:${toString svc.port}</div> in
</a> ''
''; <a class="card" href="${href}">
<div class="name">${svc.name}</div>
<div class="desc">${svc.description}</div>
<div class="port">:${toString svc.port}</div>
</a>
'';
page = pkgs.writeTextDir "index.html" '' page = pkgs.writeTextDir "index.html" ''
<!DOCTYPE html> <!DOCTYPE html>
@@ -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>.";
};
}; };
} }
); );