From bbf5ca376326363aeef437c885d98c5c3c54176e Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 13 Jun 2025 22:01:46 +0530 Subject: Move dashboard link to settings --- modules/dashboard/bacchus-dashboard.service.nix | 1 + modules/dashboard/dashboard-template.nix | 14 +++++++------- modules/dashboard/default.nix | 1 + settings.nix | 8 ++++---- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/modules/dashboard/bacchus-dashboard.service.nix b/modules/dashboard/bacchus-dashboard.service.nix index 12161c5..8b0fcb9 100644 --- a/modules/dashboard/bacchus-dashboard.service.nix +++ b/modules/dashboard/bacchus-dashboard.service.nix @@ -24,6 +24,7 @@ in type = types.listOf (types.attrs); default = []; }; + embedLink = mkOption { type = types.str; }; openFirewall = mkEnableOption "Open firewall ports"; host = mkOption { type = types.str; default = "_"; }; port = mkOption { type = types.int; default = 80; }; diff --git a/modules/dashboard/dashboard-template.nix b/modules/dashboard/dashboard-template.nix index 43812a0..4c4b67f 100644 --- a/modules/dashboard/dashboard-template.nix +++ b/modules/dashboard/dashboard-template.nix @@ -1,4 +1,4 @@ -{ title, links, ... }: +{ title, links ? [], embedLink ? null, ... }: with builtins; let withLinkAttr = link: attr: def: value: @@ -108,9 +108,7 @@ let ''; headerHTML = '' -
- ${title} -
+
${title}
''; in '' @@ -127,9 +125,11 @@ in -
- -
+ ${if embedLink == null then "" else '' +
+ +
+ ''} diff --git a/modules/dashboard/default.nix b/modules/dashboard/default.nix index 42583dd..d5ee353 100644 --- a/modules/dashboard/default.nix +++ b/modules/dashboard/default.nix @@ -11,6 +11,7 @@ in openFirewall = true; port = ports.dashboard; title = "Bacchus Dashboard"; + embedLink = settings.grafana.dashboardEmbedLink; links = [ { title = "Jellyfin"; diff --git a/settings.nix b/settings.nix index 06c10a0..be03e49 100644 --- a/settings.nix +++ b/settings.nix @@ -21,10 +21,10 @@ in lib.recursiveUpdate privateSettings rec { exposeTransmissionRPC = false; }; - git = { - baseDir = "/git"; - group = "git"; - }; + git = { + baseDir = "/git"; + group = "git"; + }; syncthing = { baseDir = "/media/syncthing"; -- cgit v1.3.1