X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fwebsites%2Fphp-application.nix;h=3a43a45e4bdd74e41dc59ca4322f8d3ac8297ee7;hb=750fe5a43b957b91a26069cf8a4fe19fc7b2633c;hp=20e2a5dde77311103aa2ab71c4ff53a4f54c3d1e;hpb=5400b9b6f65451d41a9106fae6fc00f97d83f4ef;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/websites/php-application.nix b/modules/websites/php-application.nix index 20e2a5d..3a43a45 100644 --- a/modules/websites/php-application.nix +++ b/modules/websites/php-application.nix @@ -1,4 +1,4 @@ -{ lib, config, ... }: +{ lib, config, pkgs, ... }: with lib; let cfg = config.services.phpApplication; @@ -53,6 +53,11 @@ in default = {}; description = "Pool environment to append"; }; + phpPackage = mkOption { + type = attrsOf str; + default = pkgs.php; + description = "Php package to use"; + }; phpOptions = mkOption { type = lines; default = ""; @@ -105,13 +110,6 @@ in Path to application root ''; }; - webappName = mkOption { - type = nullOr str; - default = null; - description = '' - Alias name for the app, to be used in services.websites.webappDirs - ''; - }; webRoot = mkOption { type = nullOr path; description = '' @@ -147,14 +145,6 @@ in Full paths to listen for php ''; }; - services.phpApplication.webappDirs = mkOption { - type = attrsOf path; - default = attrsets.filterAttrs (n: v: builtins.hasAttr n cfg.apps) config.services.websites.webappDirsPaths; - readOnly = true; - description = '' - Stable name webapp dirs for httpd - ''; - }; }; config = { @@ -177,14 +167,10 @@ in // optionalAttrs (icfg.phpSession) { "php_admin_value[session.save_path]" = "${icfg.varDir}/phpSessions"; } // icfg.phpPool; phpOptions = config.services.phpfpm.phpOptions + icfg.phpOptions; - inherit (icfg) phpEnv; + inherit (icfg) phpEnv phpPackage; } ) cfg.apps; - services.websites.webappDirs = attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair - (if icfg.webappName == null then name else icfg.webappName) icfg.webRoot - ) (attrsets.filterAttrs (n: v: !isNull v.webRoot) cfg.apps); - services.filesWatcher = attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair "phpfpm-${name}" { restart = true;