From 3dbc056cc0bcf3fab5f19601673a46cc6b433e5f Mon Sep 17 00:00:00 2001 From: nhnn Date: Wed, 17 Jul 2024 20:45:23 +0300 Subject: [PATCH] feat: support binds for prometheus monitoring service --- sp-modules/monitoring/module.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sp-modules/monitoring/module.nix b/sp-modules/monitoring/module.nix index 90bf806..7ad8f83 100644 --- a/sp-modules/monitoring/module.nix +++ b/sp-modules/monitoring/module.nix @@ -6,8 +6,21 @@ in { default = false; type = lib.types.bool; }; + location = lib.mkOption { + type = lib.types.str; + }; }; config = lib.mkIf cfg.enable { + fileSystems = lib.mkIf config.selfprivacy.useBinds { + "/var/lib/prometheus2" = { + device = "/volumes/${cfg.location}/prometheus"; + options = [ + "bind" + "x-systemd.required-by=prometheus.service" + "x-systemd.before=prometheus.service" + ]; + }; + }; services.prometheus = { enable = true; port = 9001; @@ -30,4 +43,4 @@ in { ]; }; }; -} \ No newline at end of file +}