From: Ismaƫl Bouya Date: Tue, 29 Jan 2019 13:45:26 +0000 (+0100) Subject: Add Florian's website X-Git-Tag: nur_publish~272 X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=commitdiff_plain;h=79f239be693bb2bad9e1cc64a32e874d96cc4cf7 Add Florian's website Fixes https://git.immae.eu/mantisbt/view.php?id=77 --- diff --git a/nixops/modules/websites/default.nix b/nixops/modules/websites/default.nix index c439b8d..3b3ccc2 100644 --- a/nixops/modules/websites/default.nix +++ b/nixops/modules/websites/default.nix @@ -93,6 +93,7 @@ in ./tellesflorian ./ftp/jerome.nix ./ftp/nassime.nix + ./ftp/florian.nix ./tools/db ./tools/tools ./tools/dav @@ -191,6 +192,7 @@ in services.myWebsites.Connexionswing.production.enable = cfg.production.enable; services.myWebsites.Jerome.production.enable = cfg.production.enable; services.myWebsites.Nassime.production.enable = cfg.production.enable; + services.myWebsites.Florian.production.enable = cfg.production.enable; services.myWebsites.Chloe.integration.enable = cfg.integration.enable; services.myWebsites.Ludivine.integration.enable = cfg.integration.enable; @@ -198,6 +200,7 @@ in services.myWebsites.PiedsJaloux.integration.enable = cfg.integration.enable; services.myWebsites.Connexionswing.integration.enable = cfg.integration.enable; services.myWebsites.TellesFlorian.integration.enable = true; + services.myWebsites.Florian.integration.enable = true; services.myWebsites.apacheConfig = { gzip = { diff --git a/nixops/modules/websites/ftp/florian.nix b/nixops/modules/websites/ftp/florian.nix new file mode 100644 index 0000000..9688700 --- /dev/null +++ b/nixops/modules/websites/ftp/florian.nix @@ -0,0 +1,73 @@ +{ lib, pkgs, config, myconfig, mylibs, ... }: +let + adminer = pkgs.callPackage ../commons/adminer.nix {}; + cfg = config.services.myWebsites.Florian; + varDir = "/var/lib/ftp/florian"; + env = myconfig.env.websites.florian; +in { + options.services.myWebsites.Florian = { + production = { + enable = lib.mkEnableOption "enable Florian's website production"; + }; + integration = { + enable = lib.mkEnableOption "enable Florian's website integration"; + }; + }; + + config = lib.mkMerge [ + (lib.mkIf cfg.production.enable { + security.acme.certs."ftp".extraDomains."tellesflorian.com" = null; + security.acme.certs."florian" = config.services.myCertificates.certConfig // { + domain = "tellesflorian.com"; + extraDomains = { + "www.tellesflorian.com" = null; + }; + }; + + services.myWebsites.production.modules = adminer.apache.modules; + services.myWebsites.production.vhostConfs.florian = { + certName = "florian"; + hosts = [ "tellesflorian.com" "www.tellesflorian.com" ]; + root = "${varDir}/tellesflorian.com"; + extraConfig = [ + adminer.apache.vhostConf + '' + ServerAdmin ${env.server_admin} + + + DirectoryIndex index.php index.htm index.html + Options Indexes FollowSymLinks MultiViews Includes + AllowOverride None + Require all granted + + '' + ]; + }; + }) + + (lib.mkIf cfg.integration.enable { + security.acme.certs."ftp".extraDomains."florian.immae.eu" = null; + security.acme.certs."eldiron".extraDomains."florian.immae.eu" = null; + + services.myWebsites.integration.modules = adminer.apache.modules; + services.myWebsites.integration.vhostConfs.florian = { + certName = "eldiron"; + hosts = [ "florian.immae.eu" ]; + root = "${varDir}/florian.immae.eu"; + extraConfig = [ + adminer.apache.vhostConf + '' + ServerAdmin ${env.server_admin} + + + DirectoryIndex index.php index.htm index.html + Options Indexes FollowSymLinks MultiViews Includes + AllowOverride None + Require all granted + + '' + ]; + }; + }) + ]; +}