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.
This commit is contained in:
parent
813cba39bb
commit
b2e3f46643
|
@ -3,12 +3,13 @@
|
|||
{
|
||||
imports = [
|
||||
|
||||
./mkcert.nix
|
||||
./lib/mkcert.nix
|
||||
|
||||
./static-files.nix
|
||||
./mailhog.localhost.nix
|
||||
./domains/mailhog.localhost.nix
|
||||
|
||||
./daniel-siepmann.localhost.nix
|
||||
./domains/tea-docs.typo3.localhost.nix
|
||||
|
||||
./domains/daniel-siepmann.localhost.nix
|
||||
|
||||
];
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
|
||||
import ./../lib/create-typo3.nix {
|
||||
inherit config lib pkgs;
|
||||
|
||||
domain = "daniel-siepmann.localhost";
|
||||
relativeDocumentRoot = "own/daniel-siepmann.de/project/public/";
|
||||
databaseName = "own_danielsiepmann";
|
||||
phpPackage = pkgs.php82;
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
import ./../lib/create-static.nix {
|
||||
inherit config;
|
||||
|
||||
domain = "tea-docs.typo3.localhost";
|
||||
relativeDocumentRoot = "typo3/tea/Documentation-GENERATED-temp/Result/project/0.0.0/";
|
||||
}
|
|
@ -1,8 +1,11 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
config
|
||||
, domain
|
||||
, relativeDocumentRoot
|
||||
}:
|
||||
|
||||
let
|
||||
domain = "tea-docs.typo3.localhost";
|
||||
documentRoot = "${config.custom.web-development.rootPath}/typo3/tea/Documentation-GENERATED-temp/Result/project/0.0.0/";
|
||||
documentRoot = "${config.custom.web-development.rootPath}/${relativeDocumentRoot}";
|
||||
in {
|
||||
services = {
|
||||
|
|
@ -1,16 +1,19 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
config
|
||||
, lib
|
||||
, pkgs
|
||||
, domain
|
||||
, relativeDocumentRoot
|
||||
, databaseName
|
||||
, phpPackage
|
||||
}:
|
||||
|
||||
# TODO: Move to template / function and call with variables
|
||||
let
|
||||
domain = "daniel-siepmann.localhost";
|
||||
documentRoot = "${config.custom.web-development.rootPath}/own/daniel-siepmann.de/project/public/";
|
||||
databaseName = "own_danielsiepmann";
|
||||
phpPackage = pkgs.php82;
|
||||
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";
|
Loading…
Reference in a new issue