git.iko.soy/typeable/nixpkgs
on master help sign in
wordpress: security upgrade: 4.7.2 -> 4.7.3 & other improvements (#23837)

* Moved the wordpress sources derivation to the attribute pkgs.wordpress. This makes it easier to override. * Also introduce the `package` option for the wordpress virtual host config which defaults to pkgs.wordpress. * Also fixed the test in nixos/tests/wordpress.nix.

commit308c09d41f309e5055e45c66c07454581945d458 authorBas van Dijk <v.dijk.bas@gmail.com> dateTue 14 Mar 2017, 16:11 (10 years ago) parente916236
4 files changed+27−19
nixos/modules/services/web-servers/apache-httpd/wordpress.nix+9−11 nixos/tests/wordpress.nix+4−8 pkgs/servers/web-apps/wordpress/default.nix+12 pkgs/top-level/all-packages.nix+2
nixos/modules/services/web-servers/apache-httpd/wordpress.nix+9−11
@@ -4,11 +4,6 @@
44with lib;
55
66let
7−
8− # Upgrading? We have a test! nix-build ./nixos/tests/wordpress.nix
9− version = "4.7.2";
10− fullversion = "${version}";
11−
127 # Our bare-bones wp-config.php file using the above settings
138 wordpressConfig = pkgs.writeText "wp-config.php" ''
149 <?php
@@ -71,12 +66,7 @@ let
7166 # The wordpress package itself
7267 wordpressRoot = pkgs.stdenv.mkDerivation rec {
7368 name = "wordpress";
74− src = pkgs.fetchFromGitHub {
75− owner = "WordPress";
76− repo = "WordPress";
77− rev = "${fullversion}";
78− sha256 = "0vph12708drf8ww0xd05hpdvbyy7n5gj9ca598lhdhy2i1j6wy32";
79− };
69+ src = config.package;
8070 installPhase = ''
8171 mkdir -p $out
8272 # copy all the wordpress files we downloaded
@@ -122,6 +112,14 @@ in
122112 enablePHP = true;
123113
124114 options = {
115+ package = mkOption {
116+ type = types.path;
117+ default = pkgs.wordpress;
118+ description = ''
119+ Path to the wordpress sources.
120+ Upgrading? We have a test! nix-build ./nixos/tests/wordpress.nix
121+ '';
122+ };
125123 dbHost = mkOption {
126124 default = "localhost";
127125 description = "The location of the database server.";
nixos/tests/wordpress.nix+4−8
@@ -10,14 +10,10 @@ import ./make-test.nix ({ pkgs, ... }:
1010 { web =
1111 { config, pkgs, ... }:
1212 {
13− services.mysql.enable = true;
14− services.mysql.package = pkgs.mysql;
15− services.mysql.initialScript = pkgs.writeText "start.sql" ''
16− CREATE DATABASE wordpress;
17− CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'wordpress';
18− GRANT ALL on wordpress.* TO 'wordpress'@'localhost';
19− '';
20−
13+ services.mysql = {
14+ enable = true;
15+ package = pkgs.mysql;
16+ };
2117 services.httpd = {
2218 enable = true;
2319 logPerVirtualHost = true;
pkgs/servers/web-apps/wordpress/default.nixnew file+12
@@ -0,0 +1,12 @@
1+ # Upgrading? We have a test! nix-build ./nixos/tests/wordpress.nix
2+{ fetchFromGitHub, lib } : fetchFromGitHub {
3+ owner = "WordPress";
4+ repo = "WordPress";
5+ rev = "4.7.3";
6+ sha256 = "05gggm40065abylp6bdc0zn0q6ahcggyh4q6rk0ak242q8v5fm5b";
7+ meta = {
8+ homepage = https://wordpress.org;
9+ description = "WordPress is open source software you can use to create a beautiful website, blog, or app.";
10+ license = lib.licenses.gpl2;
11+ };
12+}
pkgs/top-level/all-packages.nix+2
@@ -18122,6 +18122,8 @@ with pkgs;
1812218122
1812318123 wmutils-opt = callPackage ../tools/X11/wmutils-opt { };
1812418124
18125+ wordpress = callPackage ../servers/web-apps/wordpress { };
18126+
1812518127 wraith = callPackage ../applications/networking/irc/wraith { };
1812618128
1812718129 wxmupen64plus = callPackage ../misc/emulators/wxmupen64plus { };