nixpkgs/systems/hikari/web-development/lib/create-static.nix
Daniel Siepmann b2e3f46643
Extract web dev into own functions for better maintenance
Use a function for static files and TYPO3 that can be called.
That way I separate the actual domains for development from the
definition.
2023-02-07 13:53:54 +01:00

31 lines
710 B
Nix

{
config
, domain
, relativeDocumentRoot
}:
let
documentRoot = "${config.custom.web-development.rootPath}/${relativeDocumentRoot}";
in {
services = {
httpd.virtualHosts.${domain} = {
forceSSL = true;
sslServerCert = "${config.custom.web-development.certFolder}${domain}.pem";
sslServerKey = "${config.custom.web-development.certFolder}${domain}-key.pem";
inherit documentRoot;
extraConfig = ''
<Directory ${documentRoot}>
AllowOverride All
Require all granted
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
DirectoryIndex index.html Index.html
</Directory>
'';
};
};
}