aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-06-13 22:01:46 +0530
committerAkshay Nair <phenax5@gmail.com>2025-06-13 22:01:46 +0530
commitbbf5ca376326363aeef437c885d98c5c3c54176e (patch)
treee3bf0c48f3e25ea717699180aa17eed04ddff9a7
parentf5949df9e5e39140fcc66589eada13738d2cf730 (diff)
downloadhomeserver-nixos-config-bbf5ca376326363aeef437c885d98c5c3c54176e.tar.gz
homeserver-nixos-config-bbf5ca376326363aeef437c885d98c5c3c54176e.zip
Move dashboard link to settings
-rw-r--r--modules/dashboard/bacchus-dashboard.service.nix1
-rw-r--r--modules/dashboard/dashboard-template.nix14
-rw-r--r--modules/dashboard/default.nix1
-rw-r--r--settings.nix8
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";