summaryrefslogtreecommitdiff
path: root/modules/nixos/personal/monitoring.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nixos/personal/monitoring.nix')
-rw-r--r--modules/nixos/personal/monitoring.nix33
1 files changed, 19 insertions, 14 deletions
diff --git a/modules/nixos/personal/monitoring.nix b/modules/nixos/personal/monitoring.nix
index e054c51..01fe201 100644
--- a/modules/nixos/personal/monitoring.nix
+++ b/modules/nixos/personal/monitoring.nix
@@ -3,22 +3,27 @@
lib,
pkgs,
...
-}: {
- options.systemd.services = lib.mkOption {
- type = with lib.types;
- attrsOf (submodule ({
- name,
- config,
- lib,
- ...
- }: {
- options.personal.monitor =
- lib.mkEnableOption "e-mail monitoring for the ${name} seervice";
- config.onFailure = lib.optional config.personal.monitor "notify@%i.service";
- }));
+}: let
+ cfg = config.personal.monitoring;
+in {
+ options = {
+ personal.monitoring.enable = lib.mkEnableOption "e-mail monitoring of systemd services";
+ systemd.services = lib.mkOption {
+ type = with lib.types;
+ attrsOf (submodule ({
+ name,
+ config,
+ lib,
+ ...
+ }: {
+ options.personal.monitor =
+ lib.mkEnableOption "e-mail monitoring for the ${name} seervice";
+ config.onFailure = lib.optional config.personal.monitor "notify@%i.service";
+ }));
+ };
};
- config = {
+ config = lib.mkIf cfg.enable {
programs.msmtp = {
enable = true;
accounts.default = {