X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=nixops%2Fmodules%2Fwebsites%2Fdefault.nix;h=14f21160a71d98a83bce8aab32e3b7e99b025668;hb=7f6bd78f988381187bc1a75397dd332ef54263e9;hp=1d0c1d73cdd516b69efba74223d5687b5ec27f2c;hpb=d06ed384dd59432aec0cf91b92442382c63421d3;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/nixops/modules/websites/default.nix b/nixops/modules/websites/default.nix index 1d0c1d7..14f2116 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 @@ -176,10 +179,10 @@ in ]; }; - nixpkgs.config.packageOverrides = oldpkgs: rec { + nixpkgs.overlays = [ (self: super: rec { php = php72; - php72 = (oldpkgs.php72.override { - mysql.connector-c = pkgs.mariadb; + php72 = (super.php72.override { + mysql.connector-c = self.mariadb; config.php.mysqlnd = false; config.php.mysqli = false; }).overrideAttrs(old: rec { @@ -193,11 +196,11 @@ in # ext/mysqli/mysqli.c ext/mysqli/mysqli_prop.c # ''; }); - phpPackages = oldpkgs.php72Packages.override { inherit php; }; + phpPackages = super.php72Packages.override { inherit php; }; composerEnv = import ./commons/composer-env.nix { - inherit (pkgs) stdenv writeTextFile fetchurl php unzip; + inherit (self) stdenv writeTextFile fetchurl php unzip; }; - }; + }) ]; services.myWebsites.tools.databases.enable = true; services.myWebsites.tools.tools.enable = true; @@ -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,11 +292,11 @@ 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 @@ -301,8 +305,8 @@ in apaxy = { extraConfig = '' - Alias /theme ${./apache/theme} - + Alias /theme ${theme_root} + Options -Indexes AllowOverride None Require all granted @@ -405,6 +409,15 @@ 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 = ''