ctucx.git: nixfiles

ctucx' nixfiles

commit 41aa1a3063439e31a63f2a22b70db63a71fbf65a
parent ab2127687cf56165053e13959c58b5b18fc8b667
Author: Leah (ctucx) <git@ctu.cx>
Date: Fri, 16 Sep 2022 09:45:07 +0200

modules: move all linux specific modules into a subdirectory
10 files changed, 40 insertions(+), 41 deletions(-)
diff --git a/machines/lollo/gotosocial.nix b/machines/lollo/gotosocial.nix
@@ -2,8 +2,6 @@
 
 {
 
-  imports = [ ../../modules/gotosocial.nix ];
-
   age.secrets.restic-gotosocial.file = ../../secrets/lollo/restic/gotosocial.age;
 
   restic-backups.gotosocial = {
diff --git a/modules/default.nix b/modules/default.nix
@@ -5,11 +5,12 @@
   imports = (builtins.concatLists [
     (if (currentSystem == "x86_64-linux") then [
      inputs.agenix.nixosModule
-     ./restic-backups.nix
-     ./vnstati
-     ./desktop-speakers.nix
-     ./email-notify.nix
-     ./dns.nix
+     ./linux/restic-backups.nix
+     ./linux/vnstati
+     ./linux/desktop-speakers.nix
+     ./linux/email-notify.nix
+     ./linux/dns.nix
+     ./linux/gotosocial.nix
     ] else [])
     (if (currentSystem == "aarch64-darwin") then [
       ./darwin/quirks.nix
diff --git a/modules/email-notify.nix b/modules/email-notify.nix
@@ -1,34 +0,0 @@
-{ pkgs, lib, config, ... }:
-
-{
-
-  options.services.email-notify.enable = lib.mkEnableOption "Enable a service which can be used to send emails";
-
-  config = lib.mkIf config.services.email-notify.enable {
-    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."email-notify@" = {
-      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/modules/desktop-speakers.nix b/modules/linux/desktop-speakers.nix
diff --git a/modules/dns.nix b/modules/linux/dns.nix
diff --git a/modules/linux/email-notify.nix b/modules/linux/email-notify.nix
@@ -0,0 +1,34 @@
+{ pkgs, lib, config, ... }:
+
+{
+
+  options.services.email-notify.enable = lib.mkEnableOption "Enable a service which can be used to send emails";
+
+  config = lib.mkIf config.services.email-notify.enable {
+    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."email-notify@" = {
+      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/modules/gotosocial.nix b/modules/linux/gotosocial.nix
diff --git a/modules/restic-backups.nix b/modules/linux/restic-backups.nix
diff --git a/modules/vnstati/default.nix b/modules/linux/vnstati/default.nix
diff --git a/modules/vnstati/vnstati-html.nix b/modules/linux/vnstati/vnstati-html.nix