From f300ea69b66427bd2a5a92a4c4f0db0aa99392b0 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 31 Oct 2022 15:15:00 +0100 Subject: ... --- hosts/vidhar/default.nix | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) (limited to 'hosts/vidhar/default.nix') diff --git a/hosts/vidhar/default.nix b/hosts/vidhar/default.nix index 3f5d17d5..fc77f03c 100644 --- a/hosts/vidhar/default.nix +++ b/hosts/vidhar/default.nix @@ -235,25 +235,30 @@ with lib; ]; }; }; - systemd.services.loki.preStart = let - rulesYaml = generators.toYAML {} { - groups = [ - { name = "power-failures"; - rules = [ - { record = "apcupsd_power_failures:per_day"; - expr = "sum by (nodename) (rate({job=\"systemd-journal\"} | json | MESSAGE = \"Power failure.\"[1d])) * 86400"; - } - { record = "apcupsd_power_failures:per_week"; - expr = "sum by (nodename) (rate({job=\"systemd-journal\"} | json | MESSAGE = \"Power failure.\"[1w])) * 604800"; - } - ]; - } - ]; - }; - in '' - ${pkgs.coreutils}/bin/install -m 0755 -o ${config.services.loki.user} -g ${config.services.loki.group} -d ${config.services.loki.configuration.ruler.storage.local.directory}/fake - ${pkgs.coreutils}/bin/ln -sf ${pkgs.writeText "rules.yml" rulesYaml} ${config.services.loki.configuration.ruler.storage.local.directory}/fake/rules.yml - ''; + systemd.services.loki = { + preStart = let + rulesYaml = generators.toYAML {} { + groups = [ + { name = "power-failures"; + rules = [ + { record = "apcupsd_power_failures:per_day"; + expr = "sum by (nodename) (rate({job=\"systemd-journal\"} | json | MESSAGE = \"Power failure.\"[1d])) * 86400"; + } + { record = "apcupsd_power_failures:per_week"; + expr = "sum by (nodename) (rate({job=\"systemd-journal\"} | json | MESSAGE = \"Power failure.\"[1w])) * 604800"; + } + ]; + } + ]; + }; + in '' + ${pkgs.coreutils}/bin/install -m 0755 -o ${config.services.loki.user} -g ${config.services.loki.group} -d ${config.services.loki.configuration.ruler.storage.local.directory}/fake + ${pkgs.coreutils}/bin/ln -sf ${pkgs.writeText "rules.yml" rulesYaml} ${config.services.loki.configuration.ruler.storage.local.directory}/fake/rules.yml + ''; + serviceConfig.Environment = [ + "ASSUME_NO_MOVING_GC_UNSAFE_RISK_IT_WITH=go1.19" + ]; + }; services.promtail = { enable = true; configuration = { @@ -286,6 +291,9 @@ with lib; ]; }; }; + systemd.services.promtail.serviceConfig.Environment = [ + "ASSUME_NO_MOVING_GC_UNSAFE_RISK_IT_WITH=go1.19" + ]; services.apcupsd = { enable = true; -- cgit v1.2.3