diff --git a/nix/nixos-module.nix b/nix/nixos-module.nix index 3deb1e1..342ed89 100644 --- a/nix/nixos-module.nix +++ b/nix/nixos-module.nix @@ -46,6 +46,14 @@ let SESSION_SECURE_COOKIE = lib.boolToString cfg.backend.cookieSecure; }; + fpmBaseEnvironment = lib.filterAttrs ( + environmentName: environmentValue: environmentValue != "" + ) appEnvironment; + + fpmEnvironment = fpmBaseEnvironment // { + APP_KEY = "$APP_KEY"; + }; + artisan = "${phpPackage}/bin/php ${appDir}/artisan"; makeDirectoryRule = path: "d ${path} 0750 ${cfg.user} ${cfg.group} - -"; @@ -238,6 +246,7 @@ in services.phpfpm.pools.${poolName} = { inherit (cfg) user group; inherit phpPackage; + phpEnv = fpmEnvironment; settings = { "catch_workers_output" = true; "clear_env" = "no"; @@ -283,7 +292,6 @@ in systemd.services.${phpfpmService} = { after = [ "${setupService}.service" ]; requires = [ "${setupService}.service" ]; - environment = appEnvironment; serviceConfig = { EnvironmentFile = cfg.backend.environmentFile; ReadWritePaths = [