mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-24 18:04:41 +02:00
treewide: remove duplicate port settings
This commit is contained in:
parent
375424cb9f
commit
b6b9972d60
21 changed files with 58 additions and 143 deletions
|
@ -13,13 +13,6 @@ in
|
|||
options.my.services.prometheus = with lib; {
|
||||
enable = mkEnableOption "Prometheus for monitoring";
|
||||
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 9090;
|
||||
example = 3002;
|
||||
description = "Internal prometheus port";
|
||||
};
|
||||
|
||||
scrapeInterval = mkOption {
|
||||
type = types.str;
|
||||
default = "15s";
|
||||
|
@ -88,7 +81,6 @@ in
|
|||
prometheus = {
|
||||
enable = true;
|
||||
webExternalUrl = "https://monitor.${domain}";
|
||||
inherit (cfg) port;
|
||||
|
||||
inherit (cfg) retentionTime;
|
||||
|
||||
|
@ -123,7 +115,7 @@ in
|
|||
job_name = "prometheus";
|
||||
static_configs = [
|
||||
{
|
||||
targets = [ "localhost:${toString cfg.port}" ];
|
||||
targets = [ "localhost:${toString config.services.prometheus.port}" ];
|
||||
labels = {
|
||||
instance = config.networking.hostName;
|
||||
};
|
||||
|
@ -191,7 +183,7 @@ in
|
|||
webserver.virtualHosts = [
|
||||
{
|
||||
subdomain = "monitor";
|
||||
inherit (cfg) port;
|
||||
inherit (config.services.prometheus) port;
|
||||
}
|
||||
];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue