From 92c6e605b41843343c48a891a0a18e5d557d81bc Mon Sep 17 00:00:00 2001 From: Adrian Gunnar Lauterer Date: Sat, 25 May 2024 19:47:29 +0200 Subject: [PATCH] init wordpress --- machines/elrond/routes.nix | 11 ++++++++ machines/galadriel/configuration.nix | 1 + services/wordpress.nix | 38 ++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 services/wordpress.nix diff --git a/machines/elrond/routes.nix b/machines/elrond/routes.nix index 14dc751..6f573a1 100644 --- a/machines/elrond/routes.nix +++ b/machines/elrond/routes.nix @@ -1,6 +1,15 @@ { config, pkgs, lib, ... }: { services.nginx = { + virtualHosts."lauterer.it" = { + forceSSL = true; + useACMEHost = config.networking.domain; + locations."/" = { + proxyWebsockets = true; + proxyPass = "http://100.84.215.84"; + }; + }; + virtualHosts."managment.lauterer.it" = { forceSSL = true; useACMEHost = config.networking.domain; @@ -75,5 +84,7 @@ #basicAuthFile = config.sops.secrets."nginx/defaultpass".path; }; + + }; } diff --git a/machines/galadriel/configuration.nix b/machines/galadriel/configuration.nix index dea64af..f497d7c 100644 --- a/machines/galadriel/configuration.nix +++ b/machines/galadriel/configuration.nix @@ -19,6 +19,7 @@ ../../profiles/mediaserver.nix ../../services/smb.nix + ../../services/wordpress.nix ../../services/torrent.nix ../../services/mc.nix #../../services/stableDiffusion.nix diff --git a/services/wordpress.nix b/services/wordpress.nix new file mode 100644 index 0000000..618d13b --- /dev/null +++ b/services/wordpress.nix @@ -0,0 +1,38 @@ +{ config, lib, pkgs, ... }: let + + +wordpress-theme = pkgs.stdenv.mkDerivation rec { + name = "responsive"; + version = "4.7.9"; + src = pkgs.fetchzip { + url = "https://downloads.wordpress.org/theme/responsive.${version}.zip"; + hash = "sha256-7K/pwD1KAuipeOAOLXd2wqOUEhwk+uNGIllVWzDHzp0="; + }; + installPhase = "mkdir -p $out; cp -R * $out/"; +}; + +in { + services.wordpress.sites."lauterer.it" = { + languages = [ + pkgs.wordpressPackages.languages.de_DE + ]; + settings = { + WPLANG = "de_DE"; + #FORCE_SSL_ADMIN = true; + }; + extraConfig = '' + $_SERVER['HTTPS']='on'; + ''; + #themes = { + # inherit wordpress-theme; + #}; + plugins = with pkgs.wordpressPackages.plugins; [ + #anti-spam-bee + code-syntax-block + cookie-notice + wp-gdpr-compliance + ]; + + }; +} +