From f8026b6e4c869aa108f6361c8ccd50890657994d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sat, 18 May 2019 10:49:00 +0200 Subject: Move personal websites to modules --- modules/private/websites/florian/app.nix | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 modules/private/websites/florian/app.nix (limited to 'modules/private/websites/florian/app.nix') diff --git a/modules/private/websites/florian/app.nix b/modules/private/websites/florian/app.nix new file mode 100644 index 0000000..08506e1 --- /dev/null +++ b/modules/private/websites/florian/app.nix @@ -0,0 +1,38 @@ +{ lib, pkgs, config, myconfig, ... }: +let + adminer = pkgs.callPackage ../commons/adminer.nix {}; + + tellesflorian = pkgs.callPackage ./builder_app.nix { + inherit (pkgs.webapps) tellesflorian; + config = myconfig.env.websites.tellesflorian.integration; + apacheUser = config.services.httpd.Inte.user; + apacheGroup = config.services.httpd.Inte.group; + }; + + cfg = config.myServices.websites.florian.app; +in { + options.myServices.websites.florian.app.enable = lib.mkEnableOption "enable Florian's app in integration"; + + config = lib.mkIf cfg.enable { + secrets.keys = tellesflorian.keys; + services.myPhpfpm.preStart.tellesflorian_dev = tellesflorian.phpFpm.preStart; + services.myPhpfpm.serviceDependencies.tellesflorian_dev = tellesflorian.phpFpm.serviceDeps; + services.myPhpfpm.poolConfigs.tellesflorian_dev = tellesflorian.phpFpm.pool; + system.activationScripts.tellesflorian_dev = tellesflorian.activationScript; + system.extraSystemBuilderCmds = '' + mkdir -p $out/webapps + ln -s ${tellesflorian.app.webRoot} $out/webapps/${tellesflorian.apache.webappName} + ''; + services.websites.integration.modules = adminer.apache.modules ++ tellesflorian.apache.modules; + services.websites.integration.vhostConfs.tellesflorian = { + certName = "eldiron"; + addToCerts = true; + hosts = ["app.tellesflorian.com" ]; + root = tellesflorian.apache.root; + extraConfig = [ + tellesflorian.apache.vhostConf + adminer.apache.vhostConf + ]; + }; + }; +} -- cgit v1.2.3