wordpress: Add passthru.updateScript

Co-authored-by: Moritz Hedtke <moritz.hedtke@t-online.de>
This commit is contained in:
Jonas Heinrich
2022-09-26 18:38:25 +02:00
co-authored by Moritz Hedtke
parent 0ea721a941
commit 30ccd36bc5
+9 -1
View File
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, nixosTests }:
{ lib, stdenv, fetchurl, nixosTests, writeScript }:
stdenv.mkDerivation rec {
pname = "wordpress";
@@ -18,6 +18,14 @@ stdenv.mkDerivation rec {
inherit (nixosTests) wordpress;
};
passthru.updateScript = writeScript "update.sh" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p common-updater-scripts jq
set -eu -o pipefail
version=$(curl --globoff "https://api.wordpress.org/core/version-check/1.7/" | jq -r '.offers[0].version')
update-source-version wordpress $version
'';
meta = with lib; {
homepage = "https://wordpress.org";
description = "WordPress is open source software you can use to create a beautiful website, blog, or app";