This commit is contained in:
mjallen18
2026-04-08 15:08:00 -05:00
parent 025ab854f0
commit 3af0d99f98
4 changed files with 23 additions and 8 deletions

View File

@@ -7,6 +7,7 @@
}:
with lib;
let
inherit (lib.${namespace}) mkOpt mkBoolOpt;
name = "attic";
cfg = config.${namespace}.services.${name};
@@ -24,7 +25,12 @@ let
atticConfig = lib.${namespace}.mkModule {
inherit config name;
description = "attic Service";
options = { };
options = {
ntfy = {
enable = mkBoolOpt false "Enable ntfy notifications for cache rebuild failures";
envFile = mkOpt types.str "" "Path to the environment file containing NTFY_USER and NTFY_PASSWORD";
};
};
moduleConfig = {
services.atticd = {
inherit (cfg) environmentFile;
@@ -71,9 +77,13 @@ let
StandardError = "journal+console";
Restart = "no";
TimeoutStartSec = "2h";
EnvironmentFile = [ config.sops.templates."ntfy.env".path ];
}
// lib.optionalAttrs cfg.ntfy.enable {
EnvironmentFile = [ cfg.ntfy.envFile ];
};
unitConfig = lib.optionalAttrs cfg.ntfy.enable {
OnFailure = "nix-rebuild-cache-notify-failure.service";
};
unitConfig.OnFailure = "nix-rebuild-cache-notify-failure.service";
path = with pkgs; [
nix
git
@@ -125,13 +135,14 @@ let
fi;
'';
};
}
// lib.optionalAttrs cfg.ntfy.enable {
nix-rebuild-cache-notify-failure = {
description = "Notify ntfy on nix-rebuild-cache failure";
serviceConfig = {
Type = "oneshot";
ExecStart = "${ntfyFailScript}";
EnvironmentFile = [ config.sops.templates."ntfy.env".path ];
EnvironmentFile = [ cfg.ntfy.envFile ];
};
};
};

View File

@@ -52,7 +52,7 @@ let
name = "node-exporter-full.json";
path = patchDashboard "node-exporter-full.json" (pkgs.fetchurl {
url = "https://grafana.com/api/dashboards/1860/revisions/latest/download";
sha256 = "sha256-mEWSdsTn1EKpW6xoJv/s0XST46EOoUPbDugQwyngIss=";
sha256 = "sha256-IeQ72CZhtckDEihcVLhAFuSs77uWsZSENsdomSrWTHo=";
}) "ds_prometheus";
}
{