diff options
| -rw-r--r-- | modules/dashboard/bacchus-dashboard.service.nix | 1 | ||||
| -rw-r--r-- | modules/dashboard/dashboard-template.nix | 14 | ||||
| -rw-r--r-- | modules/dashboard/default.nix | 1 | ||||
| -rw-r--r-- | 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 = '' - <header> - ${title} - </header> + <header>${title}</header> ''; in '' @@ -127,9 +125,11 @@ in <section class="links-container"> ${concatStringsSep "" (map linkHTML links)} </section> - <section class="stats-container"> - <iframe src="http://grafana.local/public-dashboards/4d3d386f6eb9475bb202fe793c0a72c3"></iframe> - </section> + ${if embedLink == null then "" else '' + <section class="stats-container"> + <iframe src="${embedLink}"></iframe> + </section> + ''} <script>${script}</script> </body> </html> 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"; |
