From 480a6f4775a5e58563f4a2f3f2904c1e627dc709 Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 7 Jul 2025 20:34:31 -0500 Subject: [PATCH] refactor: abstracting out bookmark info --- .../config/bookmarks/config/development.nix | 21 ++++ .../bookmarks/config/flake/selfHosted.nix | 113 ++++++++---------- 2 files changed, 69 insertions(+), 65 deletions(-) diff --git a/modules/home/gui/apps/browsers/floorp/config/bookmarks/config/development.nix b/modules/home/gui/apps/browsers/floorp/config/bookmarks/config/development.nix index d428930..f7ba28a 100755 --- a/modules/home/gui/apps/browsers/floorp/config/bookmarks/config/development.nix +++ b/modules/home/gui/apps/browsers/floorp/config/bookmarks/config/development.nix @@ -84,5 +84,26 @@ in ]; 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"; + } ]; } diff --git a/modules/home/gui/apps/browsers/floorp/config/bookmarks/config/flake/selfHosted.nix b/modules/home/gui/apps/browsers/floorp/config/bookmarks/config/flake/selfHosted.nix index e0171cd..3f4d85f 100755 --- a/modules/home/gui/apps/browsers/floorp/config/bookmarks/config/flake/selfHosted.nix +++ b/modules/home/gui/apps/browsers/floorp/config/bookmarks/config/flake/selfHosted.nix @@ -22,77 +22,60 @@ let keyword = instances.${name}.short; }) (builtins.map (service: instances.${service}.name) services); - bookmarkConfigs = [ - { - suffix = "(Remote)"; - urlTemplate = name: "https://${instances.${name}.domains.url0}"; - services = [ - "audiobookshelf" - "forgejo" - "glance" - "jellyfin" - "mastodon" - "ollama" - "opencloud" - "owncast" - "peertube" - "searx" - "vaultwarden" - ]; - } - { - suffix = "(Desktop)"; - urlTemplate = name: "http://${mars.ip.address0}:${toString instances.${name}.ports.port0}"; - services = [ - "ollama" - "syncthing" - ]; - } - { - suffix = "(Server)"; - urlTemplate = name: "http://${ceres.ip.address0}:${toString instances.${name}.ports.port0}"; - services = [ - "jellyfin" - ]; - } - { - suffix = "(Synology)"; - urlTemplate = name: "http://${synology.ip.address0}:${toString instances.${name}.ports.port0}"; - services = [ - "syncthing" - ]; - } - ]; + bookmarkConfigs = + let + port = name: toString instances.${name}.ports.port0; + in + [ + { + suffix = "(Remote)"; + urlTemplate = name: "https://${instances.${name}.domains.url0}"; + services = [ + "audiobookshelf" + "forgejo" + "glance" + "jellyfin" + "mastodon" + "ollama" + "opencloud" + "owncast" + "peertube" + "searx" + "vaultwarden" + ]; + } + { + suffix = "(Desktop)"; + urlTemplate = "http://${mars.ip.address0}:${port}"; + services = [ + "ollama" + "syncthing" + ]; + } + { + suffix = "(Server)"; + urlTemplate = "http://${ceres.ip.address0}:${port}"; + services = [ + "jellyfin" + ]; + } + { + suffix = "(Synology)"; + urlTemplate = "http://${synology.ip.address0}:${port}"; + services = [ + "syncthing" + ]; + } + ]; generatedBookmarks = builtins.concatLists (builtins.map makeBookmarks bookmarkConfigs); flatBookmarks = [ { - 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"; - } - { - name = "Router"; + name = instances.web.label; url = "http://${instances.web.localhost.address2}"; - tags = [ ]; - keyword = "Router"; + tags = instances.web.tags; + keyword = instances.web.label; } ]; in