From: Ismaƫl Bouya Date: Thu, 10 Jan 2019 22:29:52 +0000 (+0100) Subject: Move some more configuration for websites X-Git-Tag: nur_publish~334 X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=commitdiff_plain;h=54307da49e9975ca3cce0d45fd12ade016cf90d9 Move some more configuration for websites --- diff --git a/virtual/eldiron.nix b/virtual/eldiron.nix index ad94fb2..fa5cb51 100644 --- a/virtual/eldiron.nix +++ b/virtual/eldiron.nix @@ -28,7 +28,7 @@ ./modules/gitolite.nix ./modules/gitweb.nix ./modules/databases.nix - ./modules/websites.nix + ./modules/websites ]; services.myGitolite.enable = true; services.myGitweb.enable = true; @@ -39,13 +39,8 @@ networking = { firewall = { enable = true; - allowedTCPPorts = [ 22 80 443 9418 ]; + allowedTCPPorts = [ 22 9418 ]; }; - interfaces."eth0".ipv4.addresses = [ - # 176.9.151.89 declared in nixops -> infra / tools - { address = myconfig.ips.production; prefixLength = 32; } - { address = myconfig.ips.integration; prefixLength = 32; } - ]; }; deployment = { diff --git a/virtual/modules/websites.nix b/virtual/modules/websites/default.nix similarity index 93% rename from virtual/modules/websites.nix rename to virtual/modules/websites/default.nix index d794c7a..14b9998 100644 --- a/virtual/modules/websites.nix +++ b/virtual/modules/websites/default.nix @@ -59,16 +59,16 @@ let in { imports = [ - ./websites/chloe - ./websites/ludivine - ./websites/aten - ./websites/piedsjaloux - ./websites/connexionswing + ./chloe + ./ludivine + ./aten + ./piedsjaloux + ./connexionswing # built using: # sed -e "s/services\.httpd/services\.httpdProd/g" .nix-defexpr/channels/nixpkgs/nixos/modules/services/web-servers/apache-httpd/default.nix # And removed users / groups - ./websites/apache/httpd_prod.nix - ./websites/apache/httpd_inte.nix + ./apache/httpd_prod.nix + ./apache/httpd_inte.nix ]; options.services.myWebsites = { @@ -95,6 +95,18 @@ in }; config = { + networking = { + firewall = { + enable = true; + allowedTCPPorts = [ 80 443 ]; + }; + interfaces."eth0".ipv4.addresses = [ + # 176.9.151.89 declared in nixops -> infra / tools + { address = myconfig.ips.production; prefixLength = 32; } + { address = myconfig.ips.integration; prefixLength = 32; } + ]; + }; + services.myWebsites.Chloe.production.enable = cfg.production.enable; services.myWebsites.Ludivine.production.enable = cfg.production.enable; services.myWebsites.Aten.production.enable = cfg.production.enable;