27 lines
567 B
Nix
Executable File
27 lines
567 B
Nix
Executable File
{ pkgs, inputs, ... }:
|
|
let
|
|
fortune = pkgs.writeShellScript "cgi" ''
|
|
echo "Content-type: text/html"
|
|
echo ""
|
|
${pkgs.fortune}/bin/fortune
|
|
'';
|
|
in {
|
|
services.mysql = {
|
|
enable = true;
|
|
package = pkgs.mariadb;
|
|
};
|
|
|
|
services.httpd = {
|
|
enable = true;
|
|
enablePHP = true;
|
|
# phpPackage = inputs.phps.packages.x86_64-linux.php74;
|
|
extraConfig = ''
|
|
ScriptAlias /fortune ${fortune}/bin/fortune
|
|
'';
|
|
virtualHosts."localhost" = {
|
|
documentRoot = "/var/www";
|
|
locations."/".index = "index.html index.php";
|
|
};
|
|
};
|
|
}
|