mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
43 lines
916 B
Nix
43 lines
916 B
Nix
{ pkgs, lib, config, ... }:
|
|
{
|
|
config = lib.mkIf config.swarselsystems.server.monitoring {
|
|
|
|
sops.secrets = {
|
|
grafanaadminpass = {
|
|
owner = "grafana";
|
|
}
|
|
}
|
|
users.users.grafana = {
|
|
extraGroups = [ "users" ];
|
|
};
|
|
|
|
services.grafana = {
|
|
enable = true;
|
|
dataDir = "/Vault/data/grafana";
|
|
admin_password = "$__file{/run/secrets/grafanaadminpass}";
|
|
settings = {
|
|
http_port = 3000;
|
|
http_addr = "127.0.0.1";
|
|
};
|
|
};
|
|
|
|
services.nginx = {
|
|
virtualHosts = {
|
|
"status.swarsel.win" = {
|
|
enableACME = true;
|
|
forceSSL = true;
|
|
acmeRoot = null;
|
|
locations = {
|
|
"/" = {
|
|
proxyPass = "http://localhost:3000/";
|
|
extraConfig = ''
|
|
client_max_body_size 0;
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
}
|