From 54307da49e9975ca3cce0d45fd12ade016cf90d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Thu, 10 Jan 2019 23:29:52 +0100 Subject: [PATCH] Move some more configuration for websites --- virtual/eldiron.nix | 9 ++----- .../{websites.nix => websites/default.nix} | 26 ++++++++++++++----- 2 files changed, 21 insertions(+), 14 deletions(-) rename virtual/modules/{websites.nix => websites/default.nix} (93%) 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; -- 2.41.0