style: format tree
This commit is contained in:
@@ -1,36 +1,39 @@
|
||||
{
|
||||
description = "PoC SP module for Prometheus-based monitoring";
|
||||
|
||||
outputs = { self }: {
|
||||
nixosModules.default = import ./module.nix;
|
||||
configPathsNeeded =
|
||||
builtins.fromJSON (builtins.readFile ./config-paths-needed.json);
|
||||
meta = { lib, ... }: {
|
||||
spModuleSchemaVersion = 1;
|
||||
id = "monitoring";
|
||||
name = "Prometheus";
|
||||
description = "Prometheus is used for resource monitoring and alerts.";
|
||||
svgIcon = builtins.readFile ./icon.svg;
|
||||
isMovable = false;
|
||||
isRequired = true;
|
||||
canBeBackedUp = false;
|
||||
backupDescription = "Backups are not available for Prometheus.";
|
||||
systemdServices = [
|
||||
"prometheus.service"
|
||||
];
|
||||
ownedFolders = [
|
||||
outputs =
|
||||
{ self }:
|
||||
{
|
||||
nixosModules.default = import ./module.nix;
|
||||
configPathsNeeded = builtins.fromJSON (builtins.readFile ./config-paths-needed.json);
|
||||
meta =
|
||||
{ lib, ... }:
|
||||
{
|
||||
path = "/var/lib/prometheus";
|
||||
owner = "prometheus";
|
||||
group = "prometheus";
|
||||
}
|
||||
];
|
||||
license = [
|
||||
lib.licenses.asl20
|
||||
];
|
||||
homepage = "https://prometheus.io/";
|
||||
sourcePage = "https://prometheus.io/";
|
||||
supportLevel = "normal";
|
||||
spModuleSchemaVersion = 1;
|
||||
id = "monitoring";
|
||||
name = "Prometheus";
|
||||
description = "Prometheus is used for resource monitoring and alerts.";
|
||||
svgIcon = builtins.readFile ./icon.svg;
|
||||
isMovable = false;
|
||||
isRequired = true;
|
||||
canBeBackedUp = false;
|
||||
backupDescription = "Backups are not available for Prometheus.";
|
||||
systemdServices = [
|
||||
"prometheus.service"
|
||||
];
|
||||
ownedFolders = [
|
||||
{
|
||||
path = "/var/lib/prometheus";
|
||||
owner = "prometheus";
|
||||
group = "prometheus";
|
||||
}
|
||||
];
|
||||
license = [
|
||||
lib.licenses.asl20
|
||||
];
|
||||
homepage = "https://prometheus.io/";
|
||||
sourcePage = "https://prometheus.io/";
|
||||
supportLevel = "normal";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@@ -4,23 +4,27 @@ let
|
||||
in
|
||||
{
|
||||
options.selfprivacy.modules.monitoring = {
|
||||
enable = (lib.mkOption {
|
||||
default = false;
|
||||
type = lib.types.bool;
|
||||
description = "Enable monitoring service";
|
||||
}) // {
|
||||
meta = {
|
||||
type = "enable";
|
||||
enable =
|
||||
(lib.mkOption {
|
||||
default = false;
|
||||
type = lib.types.bool;
|
||||
description = "Enable monitoring service";
|
||||
})
|
||||
// {
|
||||
meta = {
|
||||
type = "enable";
|
||||
};
|
||||
};
|
||||
};
|
||||
location = (lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Monitoring data location";
|
||||
}) // {
|
||||
meta = {
|
||||
type = "location";
|
||||
location =
|
||||
(lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Monitoring data location";
|
||||
})
|
||||
// {
|
||||
meta = {
|
||||
type = "location";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
fileSystems = lib.mkIf config.selfprivacy.useBinds {
|
||||
@@ -54,15 +58,19 @@ in
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "node-exporter";
|
||||
static_configs = [{
|
||||
targets = [ "127.0.0.1:9002" ];
|
||||
}];
|
||||
static_configs = [
|
||||
{
|
||||
targets = [ "127.0.0.1:9002" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "cadvisor";
|
||||
static_configs = [{
|
||||
targets = [ "127.0.0.1:9003" ];
|
||||
}];
|
||||
static_configs = [
|
||||
{
|
||||
targets = [ "127.0.0.1:9003" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
Reference in New Issue
Block a user