Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wordpress: Add wordpressPackages #173622

Merged
merged 2 commits into from
Oct 6, 2022
Merged

wordpress: Add wordpressPackages #173622

merged 2 commits into from
Oct 6, 2022

Conversation

onny
Copy link
Contributor

@onny onny commented May 19, 2022

Description of changes

This is the continuation of #124383 (thanks to @mohe2015 ) for packaging Wordpress plugins and themes. Similar to nodePackages, this approach uses a script (wp4nix) to generate Nix expressions using a list of package or theme names in json files.

So the workflow would be:

  1. Add the package name to the wordpress-plugins.json file
[
  "add-widget-after-content"
, "antispam-bee"
, "async-javascript"
[...]
  1. Run ./generate.sh
  2. For example, use the package pkgs.wordpressPackages.plugins.antispam-bee in the Wordpress module like this:
services.wordpress = {
  sites."blog.${config.networking.domain}" = {
    plugins = with pkgs.wordpressPackages.plugins; [
      anti-spam-bee
      code-syntax-block
      lightbox-with-photoswipe
      wp-gdpr-compliance
    ];
    themes = [ pkgs.wordpressPackages.themes.geist ];
  };
}; 

This is also described in the README.md.

Todos

  • Update README.md
  • Test it
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@onny onny changed the title [DRAFT] wordpress: package plugins and themes [DRAFT] wordpress: Add wordpressPackages Sep 24, 2022
@onny
Copy link
Contributor Author

onny commented Sep 24, 2022

fixed

Strange if I run wp4nix from nixpkgs I get following error

2022/09/24 20:18:09 A worker just exited, 1 worker(s) remaining
2022/09/24 20:18:09 info https://plugins.svn.wordpress.org/jetpack/tags/11.3.2
2022/09/24 20:18:09 Cannot list https://plugins.svn.wordpress.org/jetpack/tags/11.3.2: exit status 1
<?xml version="1.0" encoding="UTF-8"?>
<info>
svn: E170013: Unable to connect to a repository at URL 'https://plugins.svn.wordpress.org/jetpack/tags/11.3.2'
svn: E120171: Error running context: An error occurred during SSL communication
2022/09/24 20:18:09 buildPkgQueueWorker: jobs queue empty, exiting
2022/09/24 20:18:09 A worker just exited, 0 worker(s) remaining

When building wp4nix locally it works fine :(

@onny onny force-pushed the wordpress branch 8 times, most recently from a803261 to 94c1e83 Compare September 26, 2022 17:03
@onny
Copy link
Contributor Author

onny commented Sep 26, 2022

@mohe2015 Unfortunately I couldn't manage to generate wordpressPackage sets using the json files generated by wp4nix, still trying to fix this but this is more difficult. Are you familiar with it?

@onny onny requested a review from mohe2015 September 26, 2022 17:05
@mohe2015
Copy link
Contributor

@mohe2015 Unfortunately I couldn't manage to generate wordpressPackage sets using the json files generated by wp4nix, still trying to fix this but this is more difficult. Are you familiar with it?

Nothing came to my eye when looking at this PR but I'm not actively using NixOS any more so I can't check.

@onny
Copy link
Contributor Author

onny commented Sep 28, 2022

@dasJ @ajs124 @SlothOfAnarchy Thank you for your work on wp4nix. I would like to integrate Wordpress packaging into NixOS using the approach in this PR.

I would like to use the generated plugins, themes and language packages using your upstream Nix expression https://github.com/NixOS/nixpkgs/pull/173622/files#diff-e90349d673d80a4089a94ec946a314282f197cb3d431436a633ecd203fab0c8a

services.wordpress.sites."localhost" = {
  virtualHost.adminAddr = "hello@example.org";
  plugins = [ pkgs.wordpressPackages.plugins.wp-statistics ];
};

Unfortunately it currently fails

error: value is a function while a set was expected

Do you remember what was the right way to get this integrated?

@onny onny force-pushed the wordpress branch 2 times, most recently from e9648e2 to bafc7e9 Compare September 29, 2022 11:33
@onny onny changed the title [DRAFT] wordpress: Add wordpressPackages wordpress: Add wordpressPackages Sep 29, 2022
@onny onny marked this pull request as ready for review September 29, 2022 11:34
@onny
Copy link
Contributor Author

onny commented Sep 29, 2022

Thanks to your work @mohe2015 I was able to get it to work :)

@onny
Copy link
Contributor Author

onny commented Oct 1, 2022

This PR is ready for review :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants