1
Fork 0

Fix grafana sops permissions

This commit is contained in:
prescientmoon 2024-02-24 08:22:35 +01:00
parent a2fb409ab3
commit e50685ab23
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4

View file

@ -1,5 +1,11 @@
{ config, pkgs, ... }:
let secret = name: "$__file{${config.sops.secrets.${name}.path}}";
let
secret = name: "$__file{${config.sops.secrets.${name}.path}}";
sopsSettings = {
sopsFile = ../secrets.yaml;
user = "grafana";
group = "grafana";
};
in
{
imports = [
@ -7,8 +13,8 @@ in
./prometheus.nix
];
sops.secrets.grafana_smtp_pass.sopsFile = ../secrets.yaml;
sops.secrets.grafana_discord_webhook.sopsFile = ../secrets.yaml;
sops.secrets.grafana_smtp_pass = sopsSettings;
sops.secrets.grafana_discord_webhook = sopsSettings;
# {{{ Main config
services.grafana = {
@ -21,12 +27,13 @@ in
# {{{ Smtp
smtp = rec {
enabled = true;
host = "smtp.migadu.com:465";
from_name = "Grafana";
password = secret "grafana_smtp_pass";
user = "grafana@orbit.moonythm.dev";
from_name = "Grafana";
from_address = user;
skip_verify = true;
host = "smtp.migadu.com:465";
password = secret "grafana_smtp_pass";
startTLS_policy = "NoStartTLS";
};
# }}}