diff options
author | Jan Hrnko <jan.hrnko@satoshilabs.com> | 2019-12-25 23:04:55 +0100 |
---|---|---|
committer | Jan Hrnko <jan.hrnko@satoshilabs.com> | 2020-01-24 13:27:10 +0100 |
commit | 8bab2dec10d8a0ef05145ab2edd37ba3ed7e9159 (patch) | |
tree | b06488c7753bdeb9dacda42e336f8454679e8fec /pkgs/servers | |
parent | d19a8f133b189c0443ea5773fd9a7e5feebce64a (diff) |
nixos/dokuwiki: init module at 2018-04-22b
Diffstat (limited to 'pkgs/servers')
-rw-r--r-- | pkgs/servers/web-apps/dokuwiki/default.nix | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/pkgs/servers/web-apps/dokuwiki/default.nix b/pkgs/servers/web-apps/dokuwiki/default.nix index ff6fa982228c6..f12a75c8e18bb 100644 --- a/pkgs/servers/web-apps/dokuwiki/default.nix +++ b/pkgs/servers/web-apps/dokuwiki/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub }: +{ stdenv, fetchFromGitHub, writeText }: stdenv.mkDerivation rec { pname = "dokuwiki"; @@ -11,9 +11,38 @@ stdenv.mkDerivation rec { sha256 = "1na5pn4j4mi2la80ywzg1krwqdxz57mjkw0id6ga9rws809gkdjp"; }; + preload = writeText "preload.php" '' + <?php + + $config_cascade = array( + 'acl' => array( + 'default' => getenv('DOKUWIKI_ACL_AUTH_CONFIG'), + ), + 'plainauth.users' => array( + 'default' => getenv('DOKUWIKI_USERS_AUTH_CONFIG'), + 'protected' => "" // not used by default + ), + ); + ''; + + phpLocalConfig = writeText "local.php" '' + <?php + return require(getenv('DOKUWIKI_LOCAL_CONFIG')); + ?> + ''; + + phpPluginsLocalConfig = writeText "plugins.local.php" '' + <?php + return require(getenv('DOKUWIKI_PLUGINS_LOCAL_CONFIG')); + ?> + ''; + installPhase = '' mkdir -p $out/share/dokuwiki cp -r * $out/share/dokuwiki + cp ${preload} $out/share/dokuwiki/inc/preload.php + cp ${phpLocalConfig} $out/share/dokuwiki/conf/local.php + cp ${phpPluginsLocalConfig} $out/share/dokuwiki/conf/plugins.local.php ''; meta = with stdenv.lib; { |