From bd4c1ad91f112e27d53ddb04ee1a3f01d6b0d292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Tue, 25 Apr 2023 07:31:46 +0100 Subject: [PATCH 1/4] add wordpress plugins --- .woodpecker/update.yaml | 1 + default.nix | 1 + flake.nix | 1 + overlay.nix | 1 + web/wordpress-plugins/activitypub.json | 7 +++++ web/wordpress-plugins/default.nix | 29 +++++++++++++++++++ .../google-sitemap-generator.json | 7 +++++ web/wordpress-plugins/indieauth.json | 7 +++++ .../indieweb-post-kinds.json | 7 +++++ web/wordpress-plugins/indieweb.json | 7 +++++ web/wordpress-plugins/jetpack.json | 7 +++++ web/wordpress-plugins/micropub.json | 7 +++++ web/wordpress-plugins/plugins | 11 +++++++ web/wordpress-plugins/pubsubhubbub.json | 7 +++++ web/wordpress-plugins/syndication-links.json | 7 +++++ web/wordpress-plugins/update.sh | 11 +++++++ web/wordpress-plugins/webmention.json | 7 +++++ web/wordpress-plugins/wp-super-cache.json | 7 +++++ 18 files changed, 132 insertions(+) create mode 100644 web/wordpress-plugins/activitypub.json create mode 100644 web/wordpress-plugins/default.nix create mode 100644 web/wordpress-plugins/google-sitemap-generator.json create mode 100644 web/wordpress-plugins/indieauth.json create mode 100644 web/wordpress-plugins/indieweb-post-kinds.json create mode 100644 web/wordpress-plugins/indieweb.json create mode 100644 web/wordpress-plugins/jetpack.json create mode 100644 web/wordpress-plugins/micropub.json create mode 100644 web/wordpress-plugins/plugins create mode 100644 web/wordpress-plugins/pubsubhubbub.json create mode 100644 web/wordpress-plugins/syndication-links.json create mode 100755 web/wordpress-plugins/update.sh create mode 100644 web/wordpress-plugins/webmention.json create mode 100644 web/wordpress-plugins/wp-super-cache.json diff --git a/.woodpecker/update.yaml b/.woodpecker/update.yaml index 9cb3c72..d7c39f9 100644 --- a/.woodpecker/update.yaml +++ b/.woodpecker/update.yaml @@ -118,4 +118,5 @@ matrix: - python-instagram - element-web - woodpecker-server + - wordpress-plugins skip_clone: true diff --git a/default.nix b/default.nix index 1cfce43..9e09de3 100644 --- a/default.nix +++ b/default.nix @@ -68,6 +68,7 @@ in woodpecker-server hydra hydra-unstable + wordpress-plugins ; } // ( diff --git a/flake.nix b/flake.nix index ee8127f..47cced8 100644 --- a/flake.nix +++ b/flake.nix @@ -111,6 +111,7 @@ woodpecker-server hydra hydra-unstable + wordpressPlugins ; } // ( diff --git a/overlay.nix b/overlay.nix index 62ac214..2351b71 100644 --- a/overlay.nix +++ b/overlay.nix @@ -82,6 +82,7 @@ system: self: super: let ]; }); hydra-unstable = self.hydra; + wordpressPlugins = self.callPackage ./web/wordpress-plugins {}; }) riscv-overlay ]; diff --git a/web/wordpress-plugins/activitypub.json b/web/wordpress-plugins/activitypub.json new file mode 100644 index 0000000..77ede2f --- /dev/null +++ b/web/wordpress-plugins/activitypub.json @@ -0,0 +1,7 @@ +{ + "version": "0.17.0", + "pname": "activitypub", + "description": "ActivityPub", + "url": "https://downloads.wordpress.org/plugin/activitypub.0.17.0.zip", + "sha256": "5803f6fa28e243e969a8499da528feefb02f16d1683b95f421d89b6090cad315" +} diff --git a/web/wordpress-plugins/default.nix b/web/wordpress-plugins/default.nix new file mode 100644 index 0000000..645e8c0 --- /dev/null +++ b/web/wordpress-plugins/default.nix @@ -0,0 +1,29 @@ +{ + stdenv, + fetchurl, + lib, + writeScript, +}: +with builtins; +with lib; let + plugins = lists.init (splitString "\n" (readFile ./plugins)); +in + listToAttrs (map (name: { + inherit name; + value = let + source = importJSON ./${name}.json; + in + stdenv.mkDerivation { + inherit (source) pname version; + src = fetchurl { + inherit url sha256; + }; + installPhase = "mkdir -p $out; cp -R * $out/"; + meta = {inherit (source) description;}; + passthru.updateScript = + if name == "activitypub" + then ./update.sh + else []; + }; + }) + plugins) diff --git a/web/wordpress-plugins/google-sitemap-generator.json b/web/wordpress-plugins/google-sitemap-generator.json new file mode 100644 index 0000000..3975fbe --- /dev/null +++ b/web/wordpress-plugins/google-sitemap-generator.json @@ -0,0 +1,7 @@ +{ + "version": "4.1.10", + "pname": "google-sitemap-generator", + "description": "Sitemap Generator for Google", + "url": "https://downloads.wordpress.org/plugin/google-sitemap-generator.4.1.10.zip", + "sha256": "17c0982c3505e7dcb69eef1537524e33ce9e817e82acd89fa57c82226b0175cc" +} diff --git a/web/wordpress-plugins/indieauth.json b/web/wordpress-plugins/indieauth.json new file mode 100644 index 0000000..b79d254 --- /dev/null +++ b/web/wordpress-plugins/indieauth.json @@ -0,0 +1,7 @@ +{ + "version": "4.2.1", + "pname": "indieauth", + "description": "IndieAuth", + "url": "https://downloads.wordpress.org/plugin/indieauth.4.2.1.zip", + "sha256": "ad151c5c25b55b0d139f3d5df8cd3c298fc7cd2d947c602e3681199e95f8c7ab" +} diff --git a/web/wordpress-plugins/indieweb-post-kinds.json b/web/wordpress-plugins/indieweb-post-kinds.json new file mode 100644 index 0000000..815027d --- /dev/null +++ b/web/wordpress-plugins/indieweb-post-kinds.json @@ -0,0 +1,7 @@ +{ + "version": "3.6.4", + "pname": "indieweb-post-kinds", + "description": "Post Kinds", + "url": "https://downloads.wordpress.org/plugin/indieweb-post-kinds.3.6.4.zip", + "sha256": "186118759081545322becba1d4a2124de0d0e0cb33a3895aad964d932338fac1" +} diff --git a/web/wordpress-plugins/indieweb.json b/web/wordpress-plugins/indieweb.json new file mode 100644 index 0000000..1c4aa0c --- /dev/null +++ b/web/wordpress-plugins/indieweb.json @@ -0,0 +1,7 @@ +{ + "version": "4.0.0", + "pname": "indieweb", + "description": "IndieWeb", + "url": "https://downloads.wordpress.org/plugin/indieweb.4.0.0.zip", + "sha256": "0b3d3b0131cd29c24bb52663cba0e56c989a5b95135027a14747c83a46d2a73f" +} diff --git a/web/wordpress-plugins/jetpack.json b/web/wordpress-plugins/jetpack.json new file mode 100644 index 0000000..8df70db --- /dev/null +++ b/web/wordpress-plugins/jetpack.json @@ -0,0 +1,7 @@ +{ + "version": "12.0", + "pname": "jetpack", + "description": "Jetpack – WP Security, Backup, Speed, & Growth", + "url": "https://downloads.wordpress.org/plugin/jetpack.12.0.zip", + "sha256": "db722fd367ac1a2b4c5c47e213a16e9e06ad1a3e458257f708c55cdc69c51004" +} diff --git a/web/wordpress-plugins/micropub.json b/web/wordpress-plugins/micropub.json new file mode 100644 index 0000000..96ead6c --- /dev/null +++ b/web/wordpress-plugins/micropub.json @@ -0,0 +1,7 @@ +{ + "version": "2.3.3", + "pname": "micropub", + "description": "Micropub", + "url": "https://downloads.wordpress.org/plugin/micropub.2.3.3.zip", + "sha256": "98fcdb898e5d07d200b7c856f084e031d63098233ad2ecd4e54a87b9827c64b8" +} diff --git a/web/wordpress-plugins/plugins b/web/wordpress-plugins/plugins new file mode 100644 index 0000000..58f3ad0 --- /dev/null +++ b/web/wordpress-plugins/plugins @@ -0,0 +1,11 @@ +jetpack +wp-super-cache +google-sitemap-generator +indieweb +pubsubhubbub +indieweb-post-kinds +indieauth +syndication-links +micropub +webmention +activitypub diff --git a/web/wordpress-plugins/pubsubhubbub.json b/web/wordpress-plugins/pubsubhubbub.json new file mode 100644 index 0000000..1849021 --- /dev/null +++ b/web/wordpress-plugins/pubsubhubbub.json @@ -0,0 +1,7 @@ +{ + "version": "3.1.3", + "pname": "pubsubhubbub", + "description": "WebSub (FKA. PubSubHubbub)", + "url": "https://downloads.wordpress.org/plugin/pubsubhubbub.3.1.3.zip", + "sha256": "c8fe11b6e194ae08c978bdbda8aec92d80dd98c4102d956b387137ac40ca5663" +} diff --git a/web/wordpress-plugins/syndication-links.json b/web/wordpress-plugins/syndication-links.json new file mode 100644 index 0000000..571c88c --- /dev/null +++ b/web/wordpress-plugins/syndication-links.json @@ -0,0 +1,7 @@ +{ + "version": "4.4.7", + "pname": "syndication-links", + "description": "Syndication Links", + "url": "https://downloads.wordpress.org/plugin/syndication-links.4.4.7.zip", + "sha256": "097632f047a1a290a79cb66b9d28c0675c959c0c4a00576790e2d0b96c223b4b" +} diff --git a/web/wordpress-plugins/update.sh b/web/wordpress-plugins/update.sh new file mode 100755 index 0000000..dc354a2 --- /dev/null +++ b/web/wordpress-plugins/update.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p curl jq + + +set -ex + +for plugin in $(cat plugins); do + META=$(curl https://api.wordpress.org/plugins/info/1.0/$plugin.json) + SHA256=$(curl $(echo $META | jq -r '.versions[.version]') | sha256sum | awk '{print $1}') + echo $META | jq '{"version": .version, "pname": .slug, "description": .name, "url": .versions[.version], "sha256": $SHA256}' --arg SHA256 $SHA256 > $plugin.json +done diff --git a/web/wordpress-plugins/webmention.json b/web/wordpress-plugins/webmention.json new file mode 100644 index 0000000..2becb8a --- /dev/null +++ b/web/wordpress-plugins/webmention.json @@ -0,0 +1,7 @@ +{ + "version": "5.0.0", + "pname": "webmention", + "description": "Webmention", + "url": "https://downloads.wordpress.org/plugin/webmention.5.0.0.zip", + "sha256": "3530a1b516d76f8108bb3adab9022c4293b354f6b6cf3c62b47bacda933086d9" +} diff --git a/web/wordpress-plugins/wp-super-cache.json b/web/wordpress-plugins/wp-super-cache.json new file mode 100644 index 0000000..88be3f3 --- /dev/null +++ b/web/wordpress-plugins/wp-super-cache.json @@ -0,0 +1,7 @@ +{ + "version": "1.9.4", + "pname": "wp-super-cache", + "description": "WP Super Cache", + "url": "https://downloads.wordpress.org/plugin/wp-super-cache.1.9.4.zip", + "sha256": "9e9cc68a9a02a886f144157fa318fc90a10017b5b26b10569e075b10909b8d15" +} From 39b9d431b422ca88e05c2edcb2b402664dde264f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Tue, 25 Apr 2023 07:52:51 +0100 Subject: [PATCH 2/4] fix wordpress-plugins spelling --- flake.nix | 2 +- overlay.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 47cced8..5c53f94 100644 --- a/flake.nix +++ b/flake.nix @@ -111,7 +111,7 @@ woodpecker-server hydra hydra-unstable - wordpressPlugins + wordpress-plugins ; } // ( diff --git a/overlay.nix b/overlay.nix index 2351b71..da2c9a0 100644 --- a/overlay.nix +++ b/overlay.nix @@ -82,7 +82,7 @@ system: self: super: let ]; }); hydra-unstable = self.hydra; - wordpressPlugins = self.callPackage ./web/wordpress-plugins {}; + wordpress-plugins = self.callPackage ./web/wordpress-plugins {}; }) riscv-overlay ]; From 0953a534ed2310b57314c9619ab42eef394e9d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Tue, 25 Apr 2023 08:06:35 +0100 Subject: [PATCH 3/4] make it work --- web/wordpress-plugins/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/wordpress-plugins/default.nix b/web/wordpress-plugins/default.nix index 645e8c0..0d67feb 100644 --- a/web/wordpress-plugins/default.nix +++ b/web/wordpress-plugins/default.nix @@ -16,7 +16,7 @@ in stdenv.mkDerivation { inherit (source) pname version; src = fetchurl { - inherit url sha256; + inherit (source) url sha256; }; installPhase = "mkdir -p $out; cp -R * $out/"; meta = {inherit (source) description;}; From 2a1e6429f74472fbc9f9449f1bc14c3e1a6cf857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Tue, 25 Apr 2023 08:20:07 +0100 Subject: [PATCH 4/4] fix unpack --- web/wordpress-plugins/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/wordpress-plugins/default.nix b/web/wordpress-plugins/default.nix index 0d67feb..cd7765e 100644 --- a/web/wordpress-plugins/default.nix +++ b/web/wordpress-plugins/default.nix @@ -2,7 +2,7 @@ stdenv, fetchurl, lib, - writeScript, + unzip }: with builtins; with lib; let @@ -18,6 +18,10 @@ in src = fetchurl { inherit (source) url sha256; }; + nativeBuildInputs = [unzip]; + unpackPhase = '' + unzip $src + ''; installPhase = "mkdir -p $out; cp -R * $out/"; meta = {inherit (source) description;}; passthru.updateScript =