Remove Gatus monitoring
Update unstable and make kubenix follow unstable
This commit is contained in:
parent
6e88288658
commit
8dbb42f0ac
3 changed files with 18 additions and 85 deletions
|
@ -1,13 +1,8 @@
|
|||
{ lib, pkgs, nixpkgs-unstable, config, machines, ... }:
|
||||
{ lib, config, machines, ... }:
|
||||
let
|
||||
cfg = config.lab.monitoring;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
"${nixpkgs-unstable}/nixos/modules/services/monitoring/gatus.nix"
|
||||
./gatus-endpoints.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
lab.monitoring = {
|
||||
enable = lib.mkOption {
|
||||
|
@ -48,63 +43,13 @@ in
|
|||
);
|
||||
};
|
||||
|
||||
services.gatus = lib.mkIf cfg.server.enable {
|
||||
enable = true;
|
||||
package = pkgs.unstable.gatus;
|
||||
|
||||
settings = {
|
||||
storage = {
|
||||
type = "sqlite";
|
||||
path = "/srv/gatus/gatus.db";
|
||||
};
|
||||
|
||||
alerting.email = {
|
||||
from = "gatus@kun.is";
|
||||
host = "mail.smtp2go.com";
|
||||
port = 2525;
|
||||
to = "pim@kunis.nl";
|
||||
client.insecure = true;
|
||||
|
||||
default-alert = {
|
||||
enabled = true;
|
||||
failure-threshold = 2;
|
||||
success-threshold = 1;
|
||||
send-on-resolved = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
users = {
|
||||
users.gatus = {
|
||||
isSystemUser = true;
|
||||
group = "gatus";
|
||||
};
|
||||
|
||||
groups.gatus = { };
|
||||
};
|
||||
|
||||
system.activationScripts = lib.mkIf cfg.server.enable {
|
||||
gatus = ''
|
||||
mkdir -p /srv/gatus
|
||||
chown gatus:gatus /srv/gatus
|
||||
'';
|
||||
};
|
||||
|
||||
services.nginx = lib.mkIf cfg.server.enable {
|
||||
enable = true;
|
||||
|
||||
virtualHosts."${config.networking.fqdn}" = {
|
||||
locations = {
|
||||
"/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString config.services.gatus.settings.web.port}";
|
||||
recommendedProxySettings = true;
|
||||
};
|
||||
|
||||
"/prometheus/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString config.services.prometheus.port}";
|
||||
recommendedProxySettings = true;
|
||||
};
|
||||
locations."/prometheus/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString config.services.prometheus.port}";
|
||||
recommendedProxySettings = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Reference in a new issue