X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=virtual%2Feldiron.nix;h=2d1c50e4cfd67b1944032cc72de038a0f649bd52;hb=5dd28b43ebe7086d52d17d494091fec36508e380;hp=ed414298a2d44334c2af1368a0631d8b4303f5cd;hpb=25fd1d16198334f678129ddcd6e77ebf7edf9b72;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/virtual/eldiron.nix b/virtual/eldiron.nix index ed41429..2d1c50e 100644 --- a/virtual/eldiron.nix +++ b/virtual/eldiron.nix @@ -6,6 +6,7 @@ eldiron = { config, pkgs, ... }: let mypkgs = import ./packages.nix; + mylibs = import ../libs.nix; in { networking = { @@ -48,6 +49,8 @@ extraDomains = { "db-1.immae.eu" = null; "tools.immae.eu" = null; + "connexionswing.immae.eu" = null; + "sandetludo.immae.eu" = null; }; }; }; @@ -61,6 +64,7 @@ ''; poolConfigs = { adminer = mypkgs.adminer.phpFpm.pool; + connexionswing_dev = mypkgs.connexionswing_dev.phpFpm.pool; www = '' listen = /var/run/phpfpm/www.sock user = wwwrun @@ -76,10 +80,18 @@ }; }; + system.activationScripts = { + connexionswing_dev = mypkgs.connexionswing_dev.activationScript; + httpd = '' + install -d -m 0755 /var/lib/acme/acme-challenge + install -d -m 0755 /var/www + ''; + }; + services.httpd = let withSSL = domain: { enableSSL = true; - sslServerCert = "/var/lib/acme/${domain}/full.pem"; # FIXME: cert only? + sslServerCert = "/var/lib/acme/${domain}/cert.pem"; sslServerKey = "/var/lib/acme/${domain}/key.pem"; sslServerChain = "/var/lib/acme/${domain}/fullchain.pem"; }; @@ -91,12 +103,13 @@ # FIXME: http2 extraModules = pkgs.lib.lists.unique ( mypkgs.adminer.apache.modules ++ + mypkgs.connexionswing_dev.apache.modules ++ [ "macro" "ldap" "authnz_ldap" ]); - extraConfig = '' + extraConfig = assert mylibs.checkEnv "NIXOPS_HTTP_LDAP_PASSWORD"; '' LDAPSharedCacheSize 500000 LDAPCacheEntries 1024 @@ -140,6 +153,15 @@ mypkgs.ympd.apache.vhostConf ]; }) + (withSSL "eldiron" // { + listen = [ { ip = "*"; port = 443; } ]; + hostName = "connexionswing.immae.eu"; + serverAliases = [ "sandetludo.immae.eu" ]; + documentRoot = mypkgs.connexionswing_dev.webRoot; + extraConfig = builtins.concatStringsSep "\n" [ + mypkgs.connexionswing_dev.apache.vhostConf + ]; + }) { # Should go last, default fallback listen = [ { ip = "*"; port = 80; } ]; hostName = "redirectSSL"; @@ -159,10 +181,10 @@ ]; }; - # FIXME: environment variables ? security.pam.services = let pam_ldap = pkgs.pam_ldap; - pam_ldap_mysql = pkgs.writeText "mysql.conf" '' + pam_ldap_mysql = assert mylibs.checkEnv "NIXOPS_MYSQL_PAM_PASSWORD"; + pkgs.writeText "mysql.conf" '' host ldap.immae.eu base dc=immae,dc=eu binddn cn=mysql,cn=pam,ou=services,dc=immae,dc=eu