aboutsummaryrefslogtreecommitdiff
path: root/modules/dashboard
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-06-11 13:57:24 +0530
committerAkshay Nair <phenax5@gmail.com>2025-06-13 15:01:40 +0530
commite6b171f9f1d975ffe34e7a34743b5e92e8593847 (patch)
tree32714bba7679b5ece2ebcf9aeb795caeab13468e /modules/dashboard
parent2a73a5899124fa15c3962b9bd385ebd415a0ccf9 (diff)
downloadhomeserver-nixos-config-e6b171f9f1d975ffe34e7a34743b5e92e8593847.tar.gz
homeserver-nixos-config-e6b171f9f1d975ffe34e7a34743b5e92e8593847.zip
Add service router + nsd server
Diffstat (limited to 'modules/dashboard')
-rw-r--r--modules/dashboard/bacchus-dashboard.service.nix2
-rw-r--r--modules/dashboard/dashboard-template.nix19
-rw-r--r--modules/dashboard/default.nix22
3 files changed, 31 insertions, 12 deletions
diff --git a/modules/dashboard/bacchus-dashboard.service.nix b/modules/dashboard/bacchus-dashboard.service.nix
index c14111b..12161c5 100644
--- a/modules/dashboard/bacchus-dashboard.service.nix
+++ b/modules/dashboard/bacchus-dashboard.service.nix
@@ -32,7 +32,7 @@ in
config = {
services.nginx = mkIf cfg.enable {
enable = true;
- virtualHosts."${cfg.host}" = {
+ virtualHosts.${cfg.host} = {
listen = [ { addr = toString cfg.port; } ];
locations."/" = {
root = pageDir;
diff --git a/modules/dashboard/dashboard-template.nix b/modules/dashboard/dashboard-template.nix
index a1df813..5a99e20 100644
--- a/modules/dashboard/dashboard-template.nix
+++ b/modules/dashboard/dashboard-template.nix
@@ -5,12 +5,11 @@ let
if hasAttr attr link then value else def;
linkHTML = link: ''
- <div>
- <a href="${link.url}" class="card" style="${withLinkAttr link "color" "" "--color-card-accent: ${link.color}"}">
- ${link.title} ${if hasAttr "key" link then "(${link.key})" else ""}
- <div class="card-link">${link.url}</div>
- </a>
- </div>
+ <a href="${link.url}" class="card" style="${withLinkAttr link "color" "" "--color-card-accent: ${link.color}"}">
+ ${link.title} ${if hasAttr "key" link then "(${link.key})" else ""}
+ <div class="card-link">${link.url}</div>
+ ${if hasAttr "altUrl" link then ''<div class="card-link">(Alt: ${link.altUrl})</div>'' else ""}
+ </a>
'';
script = ''
@@ -86,6 +85,14 @@ let
padding-top: 1em;
color: gray;
}
+ button {
+ background: none;
+ padding: 0;
+ text-decoration: underline;
+ color: gray;
+ margin: 0;
+ border: 0;
+ }
'';
headerHTML = ''
diff --git a/modules/dashboard/default.nix b/modules/dashboard/default.nix
index 54db0d9..9e434c2 100644
--- a/modules/dashboard/default.nix
+++ b/modules/dashboard/default.nix
@@ -9,32 +9,44 @@ in
services.bacchus-dashboard = {
enable = true;
openFirewall = true;
- title = "Dashboard";
+ port = ports.dashboard;
+ title = "Bacchus Dashboard";
links = [
{
title = "Jellyfin";
key = "j";
- url = "http://${settings.network.host}:${toString ports.jellyfin}";
+ url = "http://jellyfin.local";
+ altUrl = "http://${settings.network.host}:${toString ports.jellyfin}";
color = "#AA5CC3";
}
{
title = "Sonarr";
key = "s";
- url = "http://${settings.network.host}:${toString ports.sonarr}";
+ url = "http://sonarr.local";
+ altUrl = "http://${settings.network.host}:${toString ports.sonarr}";
color = "#4c82cf";
}
{
title = "Radarr";
key = "r";
- url = "http://${settings.network.host}:${toString ports.radarr}";
+ url = "http://radarr.local";
+ altUrl = "http://${settings.network.host}:${toString ports.radarr}";
color = "#fcbd00";
}
{
title = "Prowlarr";
key = "p";
- url = "http://${settings.network.host}:${toString ports.prowlarr}";
+ url = "http://prowlarr.local";
+ altUrl = "http://${settings.network.host}:${toString ports.prowlarr}";
color = "#ff9a7e";
}
+ {
+ title = "Syncthing";
+ key = "y";
+ url = "http://syncthing.local";
+ altUrl = "http://${settings.network.host}:${toString ports.syncthing}";
+ color = "#0891d1";
+ }
];
};
}