ctucx.git: nixfiles

ctucx' nixfiles

commit 6c3614c7512868b1db4f6c1eeb13fc09f2e1fa78
parent 803906f0b85f64235e5172bfadf21368dcb3ec59
Author: Leah (ctucx) <leah@ctu.cx>
Date: Tue, 1 Feb 2022 11:55:52 +0100

move notify-failure.nix to configurations/
5 files changed, 32 insertions(+), 62 deletions(-)
diff --git a/configurations/notify-failure.nix b/configurations/notify-failure.nix
@@ -0,0 +1,30 @@
+{ config, lib, pkgs, ... }:
+
+{
+
+  age.secrets.password-leah-at-f2k1-de.file = ../secrets/passwords/leah-at-f2k1-de.age;
+
+  programs.msmtp = {
+    enable = true;
+    accounts = {
+      default = {
+        auth         = true;
+        tls          = true;
+        host         = "rx300.kunbox.net";
+        port         = 587;
+        user         = "leah@f2k1.de";
+        from         = "${config.networking.fqdn} <leah@f2k1.de>";
+        passwordeval = "cat ${config.age.secrets.password-leah-at-f2k1-de.path}";
+      };
+    };
+  };
+
+  systemd.services."notify-failure@" = {
+    serviceConfig = {
+       ExecStart = ''
+         ${pkgs.runtimeShell} -c "{ echo -n 'Subject:[${config.networking.fqdn}] Service failed: %i\n\n' &  ${pkgs.systemd}/bin/systemctl status %i;} | ${pkgs.msmtp}/bin/msmtp -v notify@ctu.cx"
+       '';
+    };
+  };
+
+}
diff --git a/machines/osterei/configuration.nix b/machines/osterei/configuration.nix
@@ -5,7 +5,7 @@
   imports = [
     ./hardware-configuration.nix
     ../../configurations/common.nix
-    ./notify-failure.nix
+    ../../configurations/notify-failure.nix
 
     ../../configurations/services/prometheus-node-exporter.nix
     ../../configurations/services/bind.nix
diff --git a/machines/osterei/notify-failure.nix b/machines/osterei/notify-failure.nix
@@ -1,30 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-{
-
-  age.secrets.password-leah-at-f2k1-de.file = ../../secrets/passwords/leah-at-f2k1-de.age;
-
-  programs.msmtp = {
-    enable = true;
-    accounts = {
-      default = {
-        auth         = true;
-        tls          = true;
-        host         = "rx300.kunbox.net";
-        port         = 587;
-        user         = "leah@f2k1.de";
-        from         = "${config.networking.fqdn} <leah@f2k1.de>";
-        passwordeval = "cat ${config.age.secrets.password-leah-at-f2k1-de.path}";
-      };
-    };
-  };
-
-  systemd.services."notify-failure@" = {
-    serviceConfig = {
-       ExecStart = ''
-         ${pkgs.runtimeShell} -c "{ echo -n 'Subject:[${config.networking.fqdn}] Service failed: %i\n\n' &  ${pkgs.systemd}/bin/systemctl status %i;} | ${pkgs.msmtp}/bin/msmtp -v notify@ctu.cx"
-       '';
-    };
-  };
-
-}
diff --git a/machines/taurus/configuration.nix b/machines/taurus/configuration.nix
@@ -5,7 +5,7 @@
   imports = [
     ./hardware-configuration.nix
     ../../configurations/common.nix
-    ./notify-failure.nix
+    ../../configurations/notify-failure.nix
 
 
     ../../configurations/services/prometheus-node-exporter.nix
diff --git a/machines/taurus/notify-failure.nix b/machines/taurus/notify-failure.nix
@@ -1,30 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-{
-
-  age.secrets.password-leah-at-f2k1-de.file = ../../secrets/passwords/leah-at-f2k1-de.age;
-
-  programs.msmtp = {
-    enable = true;
-    accounts = {
-      default = {
-        auth         = true;
-        tls          = true;
-        host         = "rx300.kunbox.net";
-        port         = 587;
-        user         = "leah@f2k1.de";
-        from         = "${config.networking.fqdn} <leah@f2k1.de>";
-        passwordeval = "cat ${config.age.secrets.password-leah-at-f2k1-de.path}";
-      };
-    };
-  };
-
-  systemd.services."notify-failure@" = {
-    serviceConfig = {
-       ExecStart = ''
-         ${pkgs.runtimeShell} -c "{ echo -n 'Subject:[${config.networking.fqdn}] Service failed: %i\n\n' &  ${pkgs.systemd}/bin/systemctl status %i;} | ${pkgs.msmtp}/bin/msmtp -v notify@ctu.cx"
-       '';
-    };
-  };
-
-}