diff --git a/modules/nixos/services/attic/default.nix b/modules/nixos/services/attic/default.nix index 7c1539f..b54704b 100755 --- a/modules/nixos/services/attic/default.nix +++ b/modules/nixos/services/attic/default.nix @@ -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 ]; }; }; }; diff --git a/modules/nixos/services/grafana/default.nix b/modules/nixos/services/grafana/default.nix index af09b72..28bc00c 100755 --- a/modules/nixos/services/grafana/default.nix +++ b/modules/nixos/services/grafana/default.nix @@ -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"; } { diff --git a/systems/x86_64-linux/jallen-nas/apps.nix b/systems/x86_64-linux/jallen-nas/apps.nix index da23dc5..7a7952c 100755 --- a/systems/x86_64-linux/jallen-nas/apps.nix +++ b/systems/x86_64-linux/jallen-nas/apps.nix @@ -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"; diff --git a/systems/x86_64-linux/jallen-nas/boot.nix b/systems/x86_64-linux/jallen-nas/boot.nix index 197bffe..427e576 100755 --- a/systems/x86_64-linux/jallen-nas/boot.nix +++ b/systems/x86_64-linux/jallen-nas/boot.nix @@ -9,7 +9,7 @@ in boot = { inherit kernelPackages; - kernelParams = [ "amd_iommu=pgtbl_v2" ]; + kernelParams = [ "amd_iommu=on" ]; initrd = { supportedFilesystems = {