manatee: Add ability to specify public url for homepage card
This commit is contained in:
@@ -9,13 +9,18 @@ let
|
||||
nginxEnabled = config.mod.nginx.enable;
|
||||
services = config.mod.homepage.services;
|
||||
|
||||
serviceToCard = svc: ''
|
||||
<a class="card" href="http://manatee:${toString svc.port}">
|
||||
<div class="name">${svc.name}</div>
|
||||
<div class="desc">${svc.description}</div>
|
||||
<div class="port">:${toString svc.port}</div>
|
||||
</a>
|
||||
'';
|
||||
serviceToCard =
|
||||
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="desc">${svc.description}</div>
|
||||
<div class="port">:${toString svc.port}</div>
|
||||
</a>
|
||||
'';
|
||||
|
||||
page = pkgs.writeTextDir "index.html" ''
|
||||
<!DOCTYPE html>
|
||||
@@ -83,6 +88,11 @@ in
|
||||
name = lib.mkOption { type = lib.types.str; };
|
||||
port = lib.mkOption { type = lib.types.port; };
|
||||
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>.";
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user