From 1754920c76b6fd0142a680b74e887022b244f3e7 Mon Sep 17 00:00:00 2001 From: Colin Arnott Date: Sun, 15 Jan 2023 10:15:58 +0000 Subject: [PATCH 1/2] wordpress: remove bundled plugins and themes Wordpress bundles some non-essential plugins and themes, then pesters users to upgrade them. As we make the whole webroot readonly, it is not possible to trivially delete them. Instead we should have users explicitly install plugins via the existing nixos module. --- .../doc/manual/from_md/release-notes/rl-2305.section.xml | 8 ++++++++ nixos/doc/manual/release-notes/rl-2305.section.md | 2 ++ pkgs/servers/web-apps/wordpress/generic.nix | 9 +++++++++ 3 files changed, 19 insertions(+) diff --git a/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml index 8679bb4b70ff..54c7da4279a5 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml @@ -302,6 +302,14 @@ here. + + + The wordpress derivation no longer contains + any builtin plugins or themes; these can be found in + wordpressPackages.{plugins,themes}, + respectively. + + llvmPackages_rocm.llvm will not contain diff --git a/nixos/doc/manual/release-notes/rl-2305.section.md b/nixos/doc/manual/release-notes/rl-2305.section.md index db80ccc9b720..19b3d2f7e121 100644 --- a/nixos/doc/manual/release-notes/rl-2305.section.md +++ b/nixos/doc/manual/release-notes/rl-2305.section.md @@ -77,6 +77,8 @@ In addition to numerous new and upgraded packages, this release has the followin - `tut` has been updated from 1.0.34 to 2.0.0, and now uses the TOML format for the configuration file instead of INI. Additional information can be found [here](https://github.com/RasmusLindroth/tut/releases/tag/2.0.0). +- The `wordpress` derivation no longer contains any builtin plugins or themes; these can be found in `wordpressPackages.{plugins,themes}`, respectively. + - `llvmPackages_rocm.llvm` will not contain `clang` or `compiler-rt`. `llvmPackages_rocm.clang` will not contain `llvm`. `llvmPackages_rocm.clangNoCompilerRt` has been removed in favor of using `llvmPackages_rocm.clang-unwrapped`. - The EC2 image module previously detected and automatically mounted ext3-formatted instance store devices and partitions in stage-1 (initramfs), storing `/tmp` on the first discovered device. This behaviour, which only catered to very specific use cases and could not be disabled, has been removed. Users relying on this should provide their own implementation, and probably use ext4 and perform the mount in stage-2. diff --git a/pkgs/servers/web-apps/wordpress/generic.nix b/pkgs/servers/web-apps/wordpress/generic.nix index e15640c88281..d2d97dab35d9 100644 --- a/pkgs/servers/web-apps/wordpress/generic.nix +++ b/pkgs/servers/web-apps/wordpress/generic.nix @@ -12,6 +12,15 @@ stdenv.mkDerivation rec { installPhase = '' runHook preInstall + # remove non-essential plugins and themes + rm -r wp-content/{plugins,themes} + mkdir wp-content/plugins + cat << EOF > wp-content/plugins/index.php + Date: Sun, 15 Jan 2023 11:43:27 +0000 Subject: [PATCH 2/2] nixos/wordpress: ensure default sites includes a theme --- nixos/doc/manual/from_md/release-notes/rl-2305.section.xml | 6 +++--- nixos/doc/manual/release-notes/rl-2305.section.md | 2 +- nixos/modules/services/web-apps/wordpress.nix | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml index 54c7da4279a5..69a6ff4aac05 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2305.section.xml @@ -305,9 +305,9 @@ The wordpress derivation no longer contains - any builtin plugins or themes; these can be found in - wordpressPackages.{plugins,themes}, - respectively. + any builtin plugins or themes. If you need them you have to + add them back to prevent your site from breaking. You can find + them in wordpressPackages.{plugins,themes}. diff --git a/nixos/doc/manual/release-notes/rl-2305.section.md b/nixos/doc/manual/release-notes/rl-2305.section.md index 19b3d2f7e121..b33221714ab5 100644 --- a/nixos/doc/manual/release-notes/rl-2305.section.md +++ b/nixos/doc/manual/release-notes/rl-2305.section.md @@ -77,7 +77,7 @@ In addition to numerous new and upgraded packages, this release has the followin - `tut` has been updated from 1.0.34 to 2.0.0, and now uses the TOML format for the configuration file instead of INI. Additional information can be found [here](https://github.com/RasmusLindroth/tut/releases/tag/2.0.0). -- The `wordpress` derivation no longer contains any builtin plugins or themes; these can be found in `wordpressPackages.{plugins,themes}`, respectively. +- The `wordpress` derivation no longer contains any builtin plugins or themes. If you need them you have to add them back to prevent your site from breaking. You can find them in `wordpressPackages.{plugins,themes}`. - `llvmPackages_rocm.llvm` will not contain `clang` or `compiler-rt`. `llvmPackages_rocm.clang` will not contain `llvm`. `llvmPackages_rocm.clangNoCompilerRt` has been removed in favor of using `llvmPackages_rocm.clang-unwrapped`. diff --git a/nixos/modules/services/web-apps/wordpress.nix b/nixos/modules/services/web-apps/wordpress.nix index aabfb2261bb6..d4c987da1144 100644 --- a/nixos/modules/services/web-apps/wordpress.nix +++ b/nixos/modules/services/web-apps/wordpress.nix @@ -156,7 +156,8 @@ let (l: warn "setting this option with a list is deprecated" listToAttrs (map (p: nameValuePair (p.name or (throw "${p} does not have a name")) p) l)) (attrsOf path); - default = {}; + default = { inherit (pkgs.wordpressPackages.themes) twentytwentythree; }; + defaultText = literalExpression "{ inherit (pkgs.wordpressPackages.themes) twentytwentythree; }"; description = lib.mdDoc '' Path(s) to respective theme(s) which are copied from the 'theme' directory.