ctucx.git: nixfiles

ctucx' nixfiles

commit 4e264ff18dcafdb4d90977749677b32106637913
parent 28824c440418f985d28b4dfe7cebecb52bdd75cd
Author: Leah (ctucx) <git@ctu.cx>
Date: Sun, 3 Dec 2023 17:59:07 +0100

machines/briefkasten/websites/wifionic.de: move to machine `trabbi`
4 files changed, 69 insertions(+), 69 deletions(-)
M
machines/briefkasten/websites/default.nix
|
1
-
D
machines/briefkasten/websites/wifionic.de.nix
|
68
--------------------------------------------------------------------
M
machines/trabbi/websites/default.nix
|
1
+
A
machines/trabbi/websites/wifionic.de.nix
|
68
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
diff --git a/machines/briefkasten/websites/default.nix b/machines/briefkasten/websites/default.nix
@@ -8,7 +8,6 @@
 #    ./storage.home.ctu.cx
 
     ./photos.ctu.cx.nix
-    ./wifionic.de.nix
   ];
 
 }
diff --git a/machines/briefkasten/websites/wifionic.de.nix b/machines/briefkasten/websites/wifionic.de.nix
@@ -1,68 +0,0 @@
-{ config, pkgs, lib, ... }:
-
-let
-  version = "262";
-
-in {
-
-  dns.zones."wifionic.de" = lib.mkIf config.networking.usePBBUplink (pkgs.dns.lib.combinators.host config.networking.primaryIP4 config.networking.primaryIP);
-
-  systemd.services.check-o2tiles = {
-    onFailure   = [ "email-notify@%i.service" ];
-    startAt     = "*-*-* 3:00:00";
-    after       = [ "network-online.target" ];
-    path        = [ pkgs.curl ];
-    script      = ''
-      curl --fail "https://dccb7552-tiles.spatialbuzz.net/tiles/o2_de-v${version}/styles/o2_de_v${version}_4g/15/17303/10472.png" 1> /dev/null;
-    '';
-    serviceConfig = {
-      Type = "oneshot";
-
-      DynamicUser             = true;
-
-      NoNewPrivileges         = true;
-      PrivateTmp              = true;
-      PrivateDevices          = true;
-
-      RestrictAddressFamilies = "AF_INET AF_INET6";
-      RestrictNamespaces      = true;
-      RestrictRealtime        = true;
-
-      ProtectSystem           = "full";
-      ProtectControlGroups    = true;
-      ProtectKernelModules    = true;
-      ProtectKernelTunables   = true;
-
-      DevicePolicy            = "closed";
-      LockPersonality         = true;
-    };
-  };
-
-
-  services.nginx = {
-    enable = true;
-    virtualHosts."wifionic.de" = {
-      enableACME = lib.mkIf config.networking.usePBBUplink true;
-      forceSSL   = lib.mkIf config.networking.usePBBUplink true;
-      kTLS       = lib.mkIf config.networking.usePBBUplink true;
-      locations  = {
-        "/".root = pkgs.mobile-coverage-map;
-
-        "/vodafone-map" = {
-          proxyPass   = "https://netmap.vodafone.de/arcgis/rest/services/CoKart/netzabdeckung_mobilfunk_4x";
-          extraConfig = "proxy_set_header Accept-Encoding '';";
-        };
-
-        "/magenta-at-map" = {
-          proxyPass   = "https://app.wigeogis.com/kunden/tmobile/data/geoserver.php";
-          extraConfig = ''
-            proxy_set_header Accept-Encoding "";
-            proxy_set_header Host "app.wigeogis.com";
-          '';
-        };
-
-      };
-    };
-  };
-
-}
diff --git a/machines/trabbi/websites/default.nix b/machines/trabbi/websites/default.nix
@@ -4,6 +4,7 @@
 
   imports = [
     ./flauschehorn.sexy.nix
+    ./wifionic.de.nix
     ./ctu.cx.nix
     ./bikemap.ctu.cx.nix
     ./things.ctu.cx.nix
diff --git a/machines/trabbi/websites/wifionic.de.nix b/machines/trabbi/websites/wifionic.de.nix
@@ -0,0 +1,68 @@
+{ config, pkgs, lib, ... }:
+
+let
+  version = "262";
+
+in {
+
+  dns.zones."wifionic.de" = (pkgs.dns.lib.combinators.host config.networking.primaryIP4 config.networking.primaryIP);
+
+  systemd.services.check-o2tiles = {
+    onFailure   = [ "email-notify@%i.service" ];
+    startAt     = "*-*-* 3:00:00";
+    after       = [ "network-online.target" ];
+    path        = [ pkgs.curl ];
+    script      = ''
+      curl --fail "https://dccb7552-tiles.spatialbuzz.net/tiles/o2_de-v${version}/styles/o2_de_v${version}_4g/15/17303/10472.png" 1> /dev/null;
+    '';
+    serviceConfig = {
+      Type = "oneshot";
+
+      DynamicUser             = true;
+
+      NoNewPrivileges         = true;
+      PrivateTmp              = true;
+      PrivateDevices          = true;
+
+      RestrictAddressFamilies = "AF_INET AF_INET6";
+      RestrictNamespaces      = true;
+      RestrictRealtime        = true;
+
+      ProtectSystem           = "full";
+      ProtectControlGroups    = true;
+      ProtectKernelModules    = true;
+      ProtectKernelTunables   = true;
+
+      DevicePolicy            = "closed";
+      LockPersonality         = true;
+    };
+  };
+
+
+  services.nginx = {
+    enable = true;
+    virtualHosts."wifionic.de" = {
+      enableACME = true;
+      forceSSL   = true;
+      kTLS       = true;
+      locations  = {
+        "/".root = pkgs.mobile-coverage-map;
+
+        "/vodafone-map" = {
+          proxyPass   = "https://netmap.vodafone.de/arcgis/rest/services/CoKart/netzabdeckung_mobilfunk_4x";
+          extraConfig = "proxy_set_header Accept-Encoding '';";
+        };
+
+        "/magenta-at-map" = {
+          proxyPass   = "https://app.wigeogis.com/kunden/tmobile/data/geoserver.php";
+          extraConfig = ''
+            proxy_set_header Accept-Encoding "";
+            proxy_set_header Host "app.wigeogis.com";
+          '';
+        };
+
+      };
+    };
+  };
+
+}