X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=nixops%2Fmodules%2Fwebsites%2Fdefault.nix;h=c8f7481935ba3cae48ab7b9b3385da06758b9da9;hb=7da3ceece7fe6c49046e97f37fc353db9b8a981c;hp=8563995d72f47f556dfe10ecd1f3dcaac71af9be;hpb=e2f5cc37a50daf28ffe5f7622d4e9803bb08c0e7;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/nixops/modules/websites/default.nix b/nixops/modules/websites/default.nix index 8563995..c8f7481 100644 --- a/nixops/modules/websites/default.nix +++ b/nixops/modules/websites/default.nix @@ -1,6 +1,8 @@ { lib, pkgs, config, mylibs, myconfig, ... }: let cfg = config.services.myWebsites; + www_root = "/run/current-system/webapps/_www"; + theme_root = "/run/current-system/webapps/_theme"; makeService = name: cfg: let toVhost = vhostConf: { enableSSL = true; @@ -21,9 +23,9 @@ let hostName = "nossl.immae.eu"; enableSSL = false; logFormat = "combinedVhost"; - documentRoot = ../../www; + documentRoot = www_root; extraConfig = '' - + DirectoryIndex nossl.html AllowOverride None Require all granted @@ -52,7 +54,7 @@ let fallbackVhost = toVhost { # Should go first, default choice certName = "eldiron"; hosts = ["eldiron.immae.eu" ]; - root = ../../www; + root = www_root; extraConfig = [ "DirectoryIndex index.htm" ]; }; in rec { @@ -127,6 +129,7 @@ in ./tools/mediagoblin ./tools/diaspora ./tools/ether + ./tools/peertube # built using: # sed -e "s/services\.httpd/services\.httpdProd/g" .nix-defexpr/channels/nixpkgs/nixos/modules/services/web-servers/apache-httpd/default.nix # Removed allGranted @@ -208,6 +211,7 @@ in services.myWebsites.tools.mediagoblin.enable = true; services.myWebsites.tools.diaspora.enable = true; services.myWebsites.tools.etherpad-lite.enable = true; + services.myWebsites.tools.peertube.enable = true; services.myWebsites.Chloe.production.enable = cfg.production.enable; services.myWebsites.Ludivine.production.enable = cfg.production.enable; @@ -288,17 +292,21 @@ in ErrorDocument 502 /maintenance_immae.html ErrorDocument 503 /maintenance_immae.html ErrorDocument 504 /maintenance_immae.html - Alias /maintenance_immae.html ${../../www}/maintenance_immae.html + Alias /maintenance_immae.html ${www_root}/maintenance_immae.html ProxyPass /maintenance_immae.html ! - AliasMatch "(.*)/googleb6d69446ff4ca3e5.html" ${../../www}/googleb6d69446ff4ca3e5.html + AliasMatch "(.*)/googleb6d69446ff4ca3e5.html" ${www_root}/googleb6d69446ff4ca3e5.html + + AllowOverride None + Require all granted + ''; }; apaxy = { extraConfig = '' - Alias /theme ${./apache/theme} - + Alias /theme ${theme_root} + Options -Indexes AllowOverride None Require all granted @@ -401,10 +409,20 @@ in ''; }; + system.extraSystemBuilderCmds = let + adminer = pkgs.callPackage ./commons/adminer.nix {}; + in '' + mkdir -p $out/webapps + ln -s ${../../www} $out/webapps/_www + ln -s ${./apache/theme} $out/webapps/_theme + ln -s ${adminer.webRoot} $out/webapps/${adminer.apache.webappName} + ''; + services.myPhpfpm = { phpPackage = pkgs.php; phpOptions = '' session.save_path = "/var/lib/php/sessions" + post_max_size = 20M session.gc_maxlifetime = 60*60*24*15 session.cache_expire = 60*24*30 '';