Added grafana

This commit is contained in:
2025-07-01 18:43:41 +03:00
parent ae8d633241
commit d5b9a7f71b
2 changed files with 36 additions and 0 deletions

View File

@@ -12,6 +12,7 @@
./../nixosModules/nextcloud.nix
./../nixosModules/wakapi.nix
./../nixosModules/eko.nix
./../nixosModules/grafana.nix
];
boot.loader.grub = {

35
nixosModules/grafana.nix Normal file
View File

@@ -0,0 +1,35 @@
{ lib, config, ... }: {
imports = [
./acme.nix
];
options = {
grafana.enable = lib.mkEnableOption "enables grafana";
};
config = lib.mkIf config.grafana.enable {
# Open http and https ports to the public
networking.firewall.allowedTCPPorts = [ 443 80 ];
# Make sure acme module is active for the "kyren.codes" ssl cert
acme.enable = true;
services.nginx.virtualHosts."grafana.kyren.codes" = {
useACMEHost = "kyren.codes";
forceSSL = true;
locations."/".proxyPass = "http://localhost:3030/";
};
sops.secrets.gitea-db-password = {
owner = config.services.gitea.user;
};
services.grafana = {
enable = true;
settings.server = {
http_port = 3030;
};
};
};
}