From 58effd5966e55cd1a14ab679f0cbd920d48a42c3 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 5 Aug 2026 20:23:38 +0200 Subject: [PATCH] fix(monitoring): wrap in block --- nixos/modules/apps/monitoring/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nixos/modules/apps/monitoring/default.nix b/nixos/modules/apps/monitoring/default.nix index 686a8f4..3e79b25 100644 --- a/nixos/modules/apps/monitoring/default.nix +++ b/nixos/modules/apps/monitoring/default.nix @@ -1,7 +1,12 @@ { config, lib, pkgs, ... }: -{ - sops.secrets."grafana/admin_password" = { +let + cfg = config.homelab.apps.monitoring; +in { + options.homelab.apps.monitoring.enable = lib.mkEnableOption "Homelab Monitoring Stack"; + + config = lib.mkIf cfg.enable { + sops.secrets."grafana/admin_password" = { sopsFile = ../../../../secrets/prod/monitoring.yaml; }; sops.secrets."alertmanager/smtp_password" = { @@ -155,4 +160,5 @@ # Open firewall for Loki so agents can push logs networking.firewall.allowedTCPPorts = [ 3100 ]; + }; }