nixos/httpd: override apachectl command to use generated httpd configuration
This commit is contained in:
parent
e23ba2a1b0
commit
0b91dfedbc
@ -10,6 +10,12 @@ let
|
|||||||
|
|
||||||
pkg = cfg.package.out;
|
pkg = cfg.package.out;
|
||||||
|
|
||||||
|
apachectl = pkgs.runCommand "apachectl" { meta.priority = -1; } ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp ${pkg}/bin/apachectl $out/bin/apachectl
|
||||||
|
sed -i $out/bin/apachectl -e 's|$HTTPD -t|$HTTPD -t -f ${httpdConf}|'
|
||||||
|
'';
|
||||||
|
|
||||||
httpdConf = cfg.configFile;
|
httpdConf = cfg.configFile;
|
||||||
|
|
||||||
php = cfg.phpPackage.override { apacheHttpd = pkg.dev; /* otherwise it only gets .out */ };
|
php = cfg.phpPackage.override { apacheHttpd = pkg.dev; /* otherwise it only gets .out */ };
|
||||||
@ -641,7 +647,10 @@ in
|
|||||||
postRun = "systemctl reload httpd.service";
|
postRun = "systemctl reload httpd.service";
|
||||||
}) (filterAttrs (name: hostOpts: hostOpts.enableACME) cfg.virtualHosts);
|
}) (filterAttrs (name: hostOpts: hostOpts.enableACME) cfg.virtualHosts);
|
||||||
|
|
||||||
environment.systemPackages = [ pkg ];
|
environment.systemPackages = [
|
||||||
|
apachectl
|
||||||
|
pkg
|
||||||
|
];
|
||||||
|
|
||||||
services.httpd.phpOptions =
|
services.httpd.phpOptions =
|
||||||
''
|
''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user