Dokuwiki: Difference between revisions

imported>Onny
mNo edit summary
imported>Onny
Update and cleanup configuration options
Line 1: Line 1:
[https://www.dokuwiki.org DokuWiki] is a web application and simple Wiki software for creating documentation and editable pages in markdown language. Compared to other Wikis, it is more minimal and only depends on PHP and file access without any need for databases.
[https://www.dokuwiki.org DokuWiki] is a web application and simple Wiki software for creating documentation and editable pages in markdown language. Compared to other Wikis, it is more minimal and only depends on PHP and file access without any need for databases.
{{Note|Parts of this instruction and module are not yet stable and will be available in the upcoming NixOS 23.05 release.}}


== Installation ==
== Installation ==
Line 8: Line 10:
services.dokuwiki.sites."localhost" = {
services.dokuwiki.sites."localhost" = {
   enable = true;
   enable = true;
   extraConfig = ''
   settings.title = "My Wiki";
    $conf['title'] = 'My Wiki';
  '';
};
};
</nowiki>}}
</nowiki>}}
Line 18: Line 18:
== Configuration ==
== Configuration ==


Besides several options which are exposed by the DokuWiki module in NixOS, you can also use <code>extraConfig</code> to add custom options to your DokuWiki configuration. See the [https://www.dokuwiki.org/config upstream documentation] for available options.
Besides several options which are exposed by the DokuWiki module in NixOS, you can also use <code>settings</code> option to add custom options to your DokuWiki configuration. See the [https://www.dokuwiki.org/config upstream documentation] for available options.


=== Templates ===
=== Templates ===
Line 27: Line 27:
let
let


   dokuwiki-template-mindthedark = pkgs.stdenv.mkDerivation {
   dokuwiki-template-mindthedark = pkgs.stdenv.mkDerivation rec {
     name = "mindthedark";
     name = "mindthedark";
     src = pkgs.fetchurl {
    version = "2021-12-24";
       url = "https://github.com/MrReSc/MindTheDark/archive/2021-12-24.zip";
     src = pkgs.fetchFromGitHub {
       sha256 = "12qwd8cz4ay4lzp69ra5cmpssqwav6nxn767l43s86ja2b7m7zia";
       owner = "MrReSc";
      repo = "MindTheDark";
      rev = version;
       sha256 = "sha256-8wWwwAYYQcUYzHpnSKOubZh7UzwfxvWXXNU7CUAiS3o=";
     };
     };
    buildInputs = [ pkgs.unzip ];
     installPhase = "mkdir -p $out; cp -R * $out/";
     installPhase = "mkdir -p $out; cp -R * $out/";
   };
   };
Line 40: Line 42:
   services.dokuwiki.sites."localhost" = {
   services.dokuwiki.sites."localhost" = {
     templates = [ dokuwiki-template-mindthedark ];
     templates = [ dokuwiki-template-mindthedark ];
     extraConfig = ''
     settings = {
       $conf['template'] = "mindthedark";
       template = "mindthedark";
       $conf['tpl']['mindthedark']['autoDark'] = true;
       tpl.mindthedark.autoDark = true;
     '';
     };
   };
   };
};
};
Line 59: Line 61:
   dokuwiki-plugin-edittable = pkgs.stdenv.mkDerivation {
   dokuwiki-plugin-edittable = pkgs.stdenv.mkDerivation {
     name = "edittable";
     name = "edittable";
     src = pkgs.fetchurl {
     src = pkgs.fetchzip {
       url = "https://github.com/cosmocode/edittable/archive/master.zip";
       url = "https://github.com/cosmocode/edittable/archive/master.zip";
       sha256 = "sha256-l+GZdFGp6wyNuCbAZB9IbwpY5c/S4vSW12VP0mJHKXs=";
       sha256 = "sha256-l+GZdFGp6wyNuCbAZB9IbwpY5c/S4vSW12VP0mJHKXs=";
     };
     };
     sourceRoot = ".";
     sourceRoot = ".";
    buildInputs = [ pkgs.unzip ];
     installPhase = "mkdir -p $out; cp -R edittable-master/* $out/";
     installPhase = "mkdir -p $out; cp -R edittable-master/* $out/";
   };
   };
Line 82: Line 83:


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
services.dokuwiki.sites."localhost".extraConfig = ''
services.dokuwiki.sites."localhost".settings = {
   $conf['userewrite'] = 1;
   userewrite = true;
'';
};
};
</nowiki>}}
</nowiki>}}
Line 95: Line 95:


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
services.dokuwiki.sites."localhost".aclUse = false;
services.dokuwiki.sites."localhost".settings = {
  acluse = false;
};
</nowiki>}}
</nowiki>}}


Line 105: Line 107:


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
services.dokuwiki.sites."localhost".extraConfig = ''
services.dokuwiki.sites."localhost".settings = {
   $conf['baseurl'] = 'https://example.org';
   baseurl = "https://example.org";
'';
};
};
</nowiki>}}
</nowiki>}}


[[Category:Web Applications]]
[[Category:Web Applications]]