refactor: abstracting out bookmark info

This commit is contained in:
Nick 2025-07-07 20:34:31 -05:00
parent 532f798bd0
commit 480a6f4775
2 changed files with 69 additions and 65 deletions

View file

@ -84,5 +84,26 @@ in
]; ];
keyword = "Hack"; keyword = "Hack";
} }
{
name = "Elm-Land Server";
url = "http://localhost:1234";
tags = [
"elm-land"
"elm"
"land"
];
keyword = "Website";
}
{
name = "Namecheap";
url = "https://www.namecheap.com";
tags = [
"namecheap"
"name"
"cheap"
"dns"
];
keyword = "Name";
}
]; ];
} }

View file

@ -22,7 +22,11 @@ let
keyword = instances.${name}.short; keyword = instances.${name}.short;
}) (builtins.map (service: instances.${service}.name) services); }) (builtins.map (service: instances.${service}.name) services);
bookmarkConfigs = [ bookmarkConfigs =
let
port = name: toString instances.${name}.ports.port0;
in
[
{ {
suffix = "(Remote)"; suffix = "(Remote)";
urlTemplate = name: "https://${instances.${name}.domains.url0}"; urlTemplate = name: "https://${instances.${name}.domains.url0}";
@ -42,7 +46,7 @@ let
} }
{ {
suffix = "(Desktop)"; suffix = "(Desktop)";
urlTemplate = name: "http://${mars.ip.address0}:${toString instances.${name}.ports.port0}"; urlTemplate = "http://${mars.ip.address0}:${port}";
services = [ services = [
"ollama" "ollama"
"syncthing" "syncthing"
@ -50,14 +54,14 @@ let
} }
{ {
suffix = "(Server)"; suffix = "(Server)";
urlTemplate = name: "http://${ceres.ip.address0}:${toString instances.${name}.ports.port0}"; urlTemplate = "http://${ceres.ip.address0}:${port}";
services = [ services = [
"jellyfin" "jellyfin"
]; ];
} }
{ {
suffix = "(Synology)"; suffix = "(Synology)";
urlTemplate = name: "http://${synology.ip.address0}:${toString instances.${name}.ports.port0}"; urlTemplate = "http://${synology.ip.address0}:${port}";
services = [ services = [
"syncthing" "syncthing"
]; ];
@ -68,31 +72,10 @@ let
flatBookmarks = [ flatBookmarks = [
{ {
name = "Elm-Land Server"; name = instances.web.label;
url = "http://localhost:1234";
tags = [
"elm-land"
"elm"
"land"
];
keyword = "Website";
}
{
name = "Namecheap";
url = "https://www.namecheap.com";
tags = [
"namecheap"
"name"
"cheap"
"dns"
];
keyword = "Name";
}
{
name = "Router";
url = "http://${instances.web.localhost.address2}"; url = "http://${instances.web.localhost.address2}";
tags = [ ]; tags = instances.web.tags;
keyword = "Router"; keyword = instances.web.label;
} }
]; ];
in in