NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.43k stars 13.64k forks source link

Unable to remove the default themes and plugins from services.wordpress as well as update wordpress? #161168

Open zeta-00 opened 2 years ago

zeta-00 commented 2 years ago

Issue description

Greetings,

I'm using the nixos services.wordpress module to host my website and it's going great, but, the issue that I'm having has to do with the built-in themes, plugins as well as wordpress itself.

Whenever I update wordpress and it's plugins, there's still red update icons that show up and message that wordpress and the built-in themes and plugins are out of date?

Steps to reproduce

Attempted to manually delete the built-in themes and plugins, and updated wordpress with nix, but, the red out of date notification still persists?

Technical details

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

nix-info -m

  • system: "aarch64-darwin"
  • host os: Darwin 21.3.0, macOS 12.2.1
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 2.4
  • channels(apple): ""
  • channels(root): "darwin, home-manager, nixpkgs-unstable-21.11pre311289.503209808cd, nixpkgs-21.11pre309670.253aecf69ed"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixpkgs
dasj19 commented 2 years ago

While not a convenient solution I did this:

patchedWordpress = pkgs.wordpress.overrideAttrs (old: {

  installPhase = old.installPhase + ''
    # Remove the default wordpress themes (to not get bothered about updates).
    rm -rf $out/share/wordpress/wp-content/themes/twentytwenty
    rm -rf $out/share/wordpress/wp-content/themes/twentytwentyone
    rm -rf $out/share/wordpress/wp-content/themes/twentytwentytwo
    # Remove default not used plugins (to not get bothered about updates).
    rm -rf $out/share/wordpress/wp-content/plugins/akismet
    rm -rf $out/share/wordpress/wp-content/plugins/hello.php
  '';
});

services.wordpress.sites."yourwebsite.com".package = patchedWordpress;
onny commented 1 year ago

The builtin plugins and themes will be removed in the upcoming NixOS release 23.05 and can be installed optionally