attic
This commit is contained in:
@@ -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 ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
{
|
||||
|
||||
@@ -26,10 +26,14 @@ in
|
||||
};
|
||||
arrs.enable = true;
|
||||
attic = {
|
||||
enable = true;
|
||||
enable = false;
|
||||
port = 9012;
|
||||
listenAddress = "[::]";
|
||||
environmentFile = "/run/secrets/jallen-nas/attic-key";
|
||||
ntfy = {
|
||||
enable = true;
|
||||
envFile = config.sops.templates."ntfy.env".path;
|
||||
};
|
||||
reverseProxy = {
|
||||
enable = true;
|
||||
subdomain = "cache";
|
||||
|
||||
@@ -9,7 +9,7 @@ in
|
||||
boot = {
|
||||
inherit kernelPackages;
|
||||
|
||||
kernelParams = [ "amd_iommu=pgtbl_v2" ];
|
||||
kernelParams = [ "amd_iommu=on" ];
|
||||
|
||||
initrd = {
|
||||
supportedFilesystems = {
|
||||
|
||||
Reference in New Issue
Block a user