]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/system/dilion.nix
Use list for ip4 addresses
[perso/Immae/Config/Nix.git] / modules / private / system / dilion.nix
index aa5bc5c1d6560329d4a5765242c440a4a863387a..cf00ba67aedd4e2f9989df69caa4c0d8d8e3156c 100644 (file)
@@ -2,7 +2,7 @@
 {
   deployment = {
     targetUser = "root";
-    targetHost = config.hostEnv.ips.main.ip4;
+    targetHost = lib.head config.hostEnv.ips.main.ip4;
     substituteOnDestination = true;
   };
   # ssh-keyscan dilion | nix-shell -p ssh-to-age --run ssh-to-age
     hostId = "27c3048d"; # generated with head -c4 /dev/urandom | od -A none -t x4
     firewall.enable = false;
     interfaces."eth0".ipv4.addresses =
-      [ { address = config.hostEnv.ips.main.ip4; prefixLength = 27; } ]
-      ++ pkgs.lib.attrsets.mapAttrsToList
-        (n: ips: { address = ips.ip4; prefixLength = 32; })
-        (pkgs.lib.attrsets.filterAttrs (n: v: n != "main") config.hostEnv.ips);
+      [ { address = lib.head config.hostEnv.ips.main.ip4; prefixLength = 27; } ]
+      ++ pkgs.lib.flatten (pkgs.lib.attrsets.mapAttrsToList
+        (n: ips: map (ip: { address = ip; prefixLength = 32; }) (ips.ip4 or []))
+        (pkgs.lib.attrsets.filterAttrs (n: v: n != "main") config.hostEnv.ips));
     interfaces."eth0".ipv6.addresses =
       [ { address = "2a01:4f8:141:53e7::"; prefixLength = 64; } ]
       ++ pkgs.lib.flatten (pkgs.lib.attrsets.mapAttrsToList
       "zulip.dine.carpentier.earth" = null;
       "zulip.quentin.carpentier.earth" = null;
       "zulip.agnes.carpentier.earth" = null;
+
+      "ofn.nc.immae.dev" = null;
+
+      "bookstack.cc.immae.dev" = null;
     };
   };
   services.nginx = {
           auth_basic_user_file ${pkgs.writeText "htpasswd" config.myEnv.websites.caldance.integration.password};
         '';
       };
+      "bookstack.cc.immae.dev" = {
+        acmeRoot = config.myServices.certificates.webroot;
+        useACMEHost = name;
+        forceSSL = true;
+        locations."/".proxyPass = "http://localhost:4003";
+      };
+      "ofn.nc.immae.dev" = {
+        acmeRoot = config.myServices.certificates.webroot;
+        useACMEHost = name;
+        forceSSL = true;
+        locations."/".proxyPass = "http://localhost:3000";
+      };
       "zulip.carpentier.earth" = {
         acmeRoot = config.myServices.certificates.webroot;
         useACMEHost = name;