9 stdenv.mkDerivation rec {
11 version = "2024-02-06b";
13 src = fetchFromGitHub {
16 rev = "release-${version}";
17 sha256 = "sha256-jrxsVBStvRxHCAOGVUkqtzE75wRBiVR+KxSCNuI2vnk=";
20 preload = writeText "preload.php" ''
23 $config_cascade = array(
25 'default' => getenv('DOKUWIKI_ACL_AUTH_CONFIG'),
27 'plainauth.users' => array(
28 'default' => getenv('DOKUWIKI_USERS_AUTH_CONFIG'),
29 'protected' => "" // not used by default
34 phpLocalConfig = writeText "local.php" ''
36 return require(getenv('DOKUWIKI_LOCAL_CONFIG'));
40 phpPluginsLocalConfig = writeText "plugins.local.php" ''
42 return require(getenv('DOKUWIKI_PLUGINS_LOCAL_CONFIG'));
49 mkdir -p $out/share/dokuwiki
50 cp -r * $out/share/dokuwiki
51 cp ${preload} $out/share/dokuwiki/inc/preload.php
52 cp ${phpLocalConfig} $out/share/dokuwiki/conf/local.php
53 cp ${phpPluginsLocalConfig} $out/share/dokuwiki/conf/plugins.local.php
59 combine = { basePackage ? dokuwiki
63 , pluginsConfig ? null
65 , pname ? (p: "${p.pname}-combined")
67 isNotEmpty = x: lib.optionalString (! builtins.elem x [ null "" ]);
68 in basePackage.overrideAttrs (prev: {
69 pname = if builtins.isFunction pname then pname prev else pname;
71 postInstall = prev.postInstall or "" + ''
72 ${lib.concatMapStringsSep "\n" (tpl: "cp -r ${toString tpl} $out/share/dokuwiki/lib/tpl/${tpl.name}") templates}
73 ${lib.concatMapStringsSep "\n" (plugin: "cp -r ${toString plugin} $out/share/dokuwiki/lib/plugins/${plugin.name}") plugins}
74 ${isNotEmpty localConfig "ln -sf ${localConfig} $out/share/dokuwiki/conf/local.php" }
75 ${isNotEmpty pluginsConfig "ln -sf ${pluginsConfig} $out/share/dokuwiki/conf/plugins.local.php" }
76 ${isNotEmpty aclConfig "ln -sf ${aclConfig} $out/share/dokuwiki/acl.auth.php" }
80 inherit (nixosTests) dokuwiki;
85 description = "Simple to use and highly versatile Open Source wiki software that doesn't require a database";
86 license = licenses.gpl2Only;
87 homepage = "https://www.dokuwiki.org";
88 platforms = platforms.all;
89 maintainers = with maintainers; [