summary refs log tree commit diff
path: root/nixos/tests/dokuwiki.nix
diff options
context:
space:
mode:
authordadada <dadada@dadada.li>2020-03-30 13:08:16 +0200
committerdadada <dadada@dadada.li>2020-04-18 23:37:18 +0200
commitaf6a7a04869889b470c4dad6e0adc57482818d3a (patch)
treeea1a6f972c0e61788e83ee963d505e333886ec49 /nixos/tests/dokuwiki.nix
parent71baf4801c6918bcbac976bd68e502d89d90ddfc (diff)
nixos/dokuwiki: add plugins and templates options
Adds support for additional plugins and templates similarly to how
wordpress.nix does it.

Plugins and templates need to be packaged as in the example.
Diffstat (limited to 'nixos/tests/dokuwiki.nix')
-rw-r--r--nixos/tests/dokuwiki.nix38
1 files changed, 35 insertions, 3 deletions
diff --git a/nixos/tests/dokuwiki.nix b/nixos/tests/dokuwiki.nix
index 65d2677dd3abf..62d8ec9f0b1ca 100644
--- a/nixos/tests/dokuwiki.nix
+++ b/nixos/tests/dokuwiki.nix
@@ -1,13 +1,43 @@
 import ./make-test-python.nix ({ pkgs, ... }:
 
-{
+let
+  template-bootstrap3 = pkgs.stdenv.mkDerivation {
+    name = "bootstrap3";
+    # Download the theme from the dokuwiki site
+    src = pkgs.fetchurl {
+      url = https://github.com/giterlizzi/dokuwiki-template-bootstrap3/archive/v2019-05-22.zip;
+      sha256 = "4de5ff31d54dd61bbccaf092c9e74c1af3a4c53e07aa59f60457a8f00cfb23a6";
+    };
+    # We need unzip to build this package
+    buildInputs = [ pkgs.unzip ];
+    # Installing simply means copying all files to the output directory
+    installPhase = "mkdir -p $out; cp -R * $out/";
+  };
+
+
+  # Let's package the icalevents plugin
+  plugin-icalevents = pkgs.stdenv.mkDerivation {
+    name = "icalevents";
+    # Download the plugin from the dokuwiki site
+    src = pkgs.fetchurl {
+      url = https://github.com/real-or-random/dokuwiki-plugin-icalevents/releases/download/2017-06-16/dokuwiki-plugin-icalevents-2017-06-16.zip;
+      sha256 = "e40ed7dd6bbe7fe3363bbbecb4de481d5e42385b5a0f62f6a6ce6bf3a1f9dfa8";
+    };
+    # We need unzip to build this package
+    buildInputs = [ pkgs.unzip ];
+    sourceRoot = ".";
+    # Installing simply means copying all files to the output directory
+    installPhase = "mkdir -p $out; cp -R * $out/";
+  };
+
+in {
   name = "dokuwiki";
   meta.maintainers = with pkgs.lib.maintainers; [ "1000101" ];
 
   machine = { ... }: {
     services.dokuwiki."site1.local" = {
       acl = " ";
-      superUser = null;
+      superUser = "admin";
       nginx = {
         forceSSL = false;
         enableACME = false;
@@ -15,11 +45,13 @@ import ./make-test-python.nix ({ pkgs, ... }:
     };
     services.dokuwiki."site2.local" = {
       acl = " ";
-      superUser = null;
+      superUser = "admin";
       nginx = {
         forceSSL = false;
         enableACME = false;
       };
+      templates = [ template-bootstrap3 ];
+      plugins = [ plugin-icalevents ];
     };
     networking.hosts."127.0.0.1" = [ "site1.local" "site2.local" ];
   };