Browse Source

server7: serve nix-serve on yggdrasil

master
Emery Hemingway 3 months ago
parent
commit
0a196b0d80
2 changed files with 22 additions and 12 deletions
  1. 14
    6
      hosts/server7/default.nix
  2. 8
    6
      hosts/server7/nix-serve.nix

+ 14
- 6
hosts/server7/default.nix View File

@@ -53,12 +53,20 @@ in {
53 53
   services.yggdrasil = {
54 54
     enable = true;
55 55
     configFile = "/var/lib/yggdrasil/keys";
56
-    config.Peers = [
57
-      "tcp://[2a03:3b40:fe:ab::1]:46370" # Praha
58
-      "tcp://ygg.thingylabs.io:443" # Nürnberg
59
-      "tcp://176.223.130.120:22632" # Wrocław
60
-      "tcp://[2a05:9403::8b]:7743" # Praha
61
-    ];
56
+    config = {
57
+      Peers = [
58
+        "tcp://[2a03:3b40:fe:ab::1]:46370" # Praha
59
+        "tcp://ygg.thingylabs.io:443" # Nürnberg
60
+        "tcp://176.223.130.120:22632" # Wrocław
61
+        "tcp://[2a05:9403::8b]:7743" # Praha
62
+      ];
63
+      NodeInfo = {
64
+        location = "Dresden";
65
+        name = "server7.y.c3d2.de";
66
+        admin =
67
+          "toxid:DF0AC9107E0A30E7201C6832B017AC836FBD1EDAC390EE99B68625D73C3FD929FB47F1872CA4";
68
+      };
69
+    };
62 70
   };
63 71
 
64 72
   security.sudo.wheelNeedsPassword = false;

+ 8
- 6
hosts/server7/nix-serve.nix View File

@@ -10,15 +10,17 @@
10 10
 
11 11
   services.nginx = {
12 12
     enable = true;
13
-    virtualHosts = {
14
-      "cache.server7.hq.c3d2.de" = {
13
+    virtualHosts = let
14
+      vhost.locations."/".proxyPass =
15
+        "http://${config.services.nix-serve.bindAddress}:${
16
+          toString config.services.nix-serve.port
17
+        }";
18
+    in {
19
+      "cache.server7.hq.c3d2.de" = vhost // {
15 20
         addSSL = true;
16 21
         enableACME = true;
17
-        locations."/".proxyPass =
18
-          "http://${config.services.nix-serve.bindAddress}:${
19
-            toString config.services.nix-serve.port
20
-          }";
21 22
       };
23
+      "nix-serve.y.c3d2.de" = vhost;
22 24
     };
23 25
   };
24 26
 

Loading…
Cancel
Save