nixos/httpd: override apachectl command to use generated httpd configuration
This commit is contained in:
parent
e23ba2a1b0
commit
0b91dfedbc
1 changed files with 10 additions and 1 deletions
|
@ -10,6 +10,12 @@ let
|
|||
|
||||
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;
|
||||
|
||||
php = cfg.phpPackage.override { apacheHttpd = pkg.dev; /* otherwise it only gets .out */ };
|
||||
|
@ -641,7 +647,10 @@ in
|
|||
postRun = "systemctl reload httpd.service";
|
||||
}) (filterAttrs (name: hostOpts: hostOpts.enableACME) cfg.virtualHosts);
|
||||
|
||||
environment.systemPackages = [ pkg ];
|
||||
environment.systemPackages = [
|
||||
apachectl
|
||||
pkg
|
||||
];
|
||||
|
||||
services.httpd.phpOptions =
|
||||
''
|
||||
|
|
Loading…
Reference in a new issue