summary refs log tree commit diff
path: root/nixos/modules/services/web-servers/apache-httpd
diff options
context:
space:
mode:
authorBas van Dijk <v.dijk.bas@gmail.com>2017-03-14 16:11:51 +0100
committerJoachim Schiele <js@lastlog.de>2017-03-14 16:11:51 +0100
commit308c09d41f309e5055e45c66c07454581945d458 (patch)
treefae5732f069338de5d7f4f6a3b722d05a038f478 /nixos/modules/services/web-servers/apache-httpd
parente916236130c98c5de723ee742f54b1c22ad6230e (diff)
downloadnixlib-308c09d41f309e5055e45c66c07454581945d458.tar
nixlib-308c09d41f309e5055e45c66c07454581945d458.tar.gz
nixlib-308c09d41f309e5055e45c66c07454581945d458.tar.bz2
nixlib-308c09d41f309e5055e45c66c07454581945d458.tar.lz
nixlib-308c09d41f309e5055e45c66c07454581945d458.tar.xz
nixlib-308c09d41f309e5055e45c66c07454581945d458.tar.zst
nixlib-308c09d41f309e5055e45c66c07454581945d458.zip
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.
Diffstat (limited to 'nixos/modules/services/web-servers/apache-httpd')
-rw-r--r--nixos/modules/services/web-servers/apache-httpd/wordpress.nix20
1 files changed, 9 insertions, 11 deletions
diff --git a/nixos/modules/services/web-servers/apache-httpd/wordpress.nix b/nixos/modules/services/web-servers/apache-httpd/wordpress.nix
index a5b6548d3c53..b94ec14308be 100644
--- a/nixos/modules/services/web-servers/apache-httpd/wordpress.nix
+++ b/nixos/modules/services/web-servers/apache-httpd/wordpress.nix
@@ -4,11 +4,6 @@
 with lib;
 
 let
-
-  # Upgrading? We have a test! nix-build ./nixos/tests/wordpress.nix
-  version = "4.7.2";
-  fullversion = "${version}";
-
   # Our bare-bones wp-config.php file using the above settings
   wordpressConfig = pkgs.writeText "wp-config.php" ''
     <?php
@@ -71,12 +66,7 @@ let
   # The wordpress package itself
   wordpressRoot = pkgs.stdenv.mkDerivation rec {
     name = "wordpress";
-    src = pkgs.fetchFromGitHub {
-      owner = "WordPress";
-      repo = "WordPress";
-      rev = "${fullversion}";
-      sha256 = "0vph12708drf8ww0xd05hpdvbyy7n5gj9ca598lhdhy2i1j6wy32";
-    };
+    src = config.package;
     installPhase = ''
       mkdir -p $out
       # copy all the wordpress files we downloaded
@@ -122,6 +112,14 @@ in
   enablePHP = true;
 
   options = {
+    package = mkOption {
+      type = types.path;
+      default = pkgs.wordpress;
+      description = ''
+        Path to the wordpress sources.
+        Upgrading? We have a test! nix-build ./nixos/tests/wordpress.nix
+      '';
+    };
     dbHost = mkOption {
       default = "localhost";
       description = "The location of the database server.";