attic
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
}:
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
|
inherit (lib.${namespace}) mkOpt mkBoolOpt;
|
||||||
name = "attic";
|
name = "attic";
|
||||||
cfg = config.${namespace}.services.${name};
|
cfg = config.${namespace}.services.${name};
|
||||||
|
|
||||||
@@ -24,7 +25,12 @@ let
|
|||||||
atticConfig = lib.${namespace}.mkModule {
|
atticConfig = lib.${namespace}.mkModule {
|
||||||
inherit config name;
|
inherit config name;
|
||||||
description = "attic Service";
|
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 = {
|
moduleConfig = {
|
||||||
services.atticd = {
|
services.atticd = {
|
||||||
inherit (cfg) environmentFile;
|
inherit (cfg) environmentFile;
|
||||||
@@ -71,9 +77,13 @@ let
|
|||||||
StandardError = "journal+console";
|
StandardError = "journal+console";
|
||||||
Restart = "no";
|
Restart = "no";
|
||||||
TimeoutStartSec = "2h";
|
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; [
|
path = with pkgs; [
|
||||||
nix
|
nix
|
||||||
git
|
git
|
||||||
@@ -125,13 +135,14 @@ let
|
|||||||
fi;
|
fi;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
// lib.optionalAttrs cfg.ntfy.enable {
|
||||||
nix-rebuild-cache-notify-failure = {
|
nix-rebuild-cache-notify-failure = {
|
||||||
description = "Notify ntfy on nix-rebuild-cache failure";
|
description = "Notify ntfy on nix-rebuild-cache failure";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ExecStart = "${ntfyFailScript}";
|
ExecStart = "${ntfyFailScript}";
|
||||||
EnvironmentFile = [ config.sops.templates."ntfy.env".path ];
|
EnvironmentFile = [ cfg.ntfy.envFile ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ let
|
|||||||
name = "node-exporter-full.json";
|
name = "node-exporter-full.json";
|
||||||
path = patchDashboard "node-exporter-full.json" (pkgs.fetchurl {
|
path = patchDashboard "node-exporter-full.json" (pkgs.fetchurl {
|
||||||
url = "https://grafana.com/api/dashboards/1860/revisions/latest/download";
|
url = "https://grafana.com/api/dashboards/1860/revisions/latest/download";
|
||||||
sha256 = "sha256-mEWSdsTn1EKpW6xoJv/s0XST46EOoUPbDugQwyngIss=";
|
sha256 = "sha256-IeQ72CZhtckDEihcVLhAFuSs77uWsZSENsdomSrWTHo=";
|
||||||
}) "ds_prometheus";
|
}) "ds_prometheus";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,10 +26,14 @@ in
|
|||||||
};
|
};
|
||||||
arrs.enable = true;
|
arrs.enable = true;
|
||||||
attic = {
|
attic = {
|
||||||
enable = true;
|
enable = false;
|
||||||
port = 9012;
|
port = 9012;
|
||||||
listenAddress = "[::]";
|
listenAddress = "[::]";
|
||||||
environmentFile = "/run/secrets/jallen-nas/attic-key";
|
environmentFile = "/run/secrets/jallen-nas/attic-key";
|
||||||
|
ntfy = {
|
||||||
|
enable = true;
|
||||||
|
envFile = config.sops.templates."ntfy.env".path;
|
||||||
|
};
|
||||||
reverseProxy = {
|
reverseProxy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
subdomain = "cache";
|
subdomain = "cache";
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ in
|
|||||||
boot = {
|
boot = {
|
||||||
inherit kernelPackages;
|
inherit kernelPackages;
|
||||||
|
|
||||||
kernelParams = [ "amd_iommu=pgtbl_v2" ];
|
kernelParams = [ "amd_iommu=on" ];
|
||||||
|
|
||||||
initrd = {
|
initrd = {
|
||||||
supportedFilesystems = {
|
supportedFilesystems = {
|
||||||
|
|||||||
Reference in New Issue
Block a user