From 75fd47230d2d5d0b1799ea71dc33132f05535115 Mon Sep 17 00:00:00 2001 From: sinavir Date: Fri, 13 Jan 2023 13:27:38 +0100 Subject: [PATCH] wiki --- hosts/org/configuration.nix | 8 ++++ hosts/org/dokuwiki.nix | 68 ++++++++++++++++++++++++++++++ default.nix => shared/dokuwiki.nix | 0 3 files changed, 76 insertions(+) create mode 100644 hosts/org/dokuwiki.nix rename default.nix => shared/dokuwiki.nix (100%) diff --git a/hosts/org/configuration.nix b/hosts/org/configuration.nix index 39be5c1..3d27d26 100644 --- a/hosts/org/configuration.nix +++ b/hosts/org/configuration.nix @@ -13,10 +13,18 @@ ../../secrets ./webpass.nix ./nginx.nix + ./dokuwiki.nix ]; networking.hostName = "hackens-org"; # Define your hostname. + # dokuwiki overlay + nixpkgs.overlays = [ + (self: super: { + dokuwiki = self.pkgs.callPackage ../../shared/dokuwiki.nix {}; + }) + ]; + # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/hosts/org/dokuwiki.nix b/hosts/org/dokuwiki.nix new file mode 100644 index 0000000..d04f95c --- /dev/null +++ b/hosts/org/dokuwiki.nix @@ -0,0 +1,68 @@ +{ config, pkgs, lib, ... }: { + services.nginx.virtualHosts."new.hackens.org" = { + enableACME = true; + forceSSL = true; + }; + + services.dokuwiki.sites."new.hackens.org" = { + enable = true; + settings = { + template = "bootstrap3"; + license = "cc-by-sa"; + title = "hackENS"; + lang = "fr"; + breadcrumbs = 0; + yourarehere = true; + userewrite = 1; + htmlok = 1; + }; + + package = pkgs.dokuwiki.combine { + plugins = [ + + (pkgs.stdenv.mkDerivation { + name = "catlist"; + src = pkgs.fetchFromGitHub { + owner = "xif-fr"; + repo = "dokuwiki-plugin-catlist"; + rev = "89e024cbf3c0e30def6db6651c72eb76de396785"; + hash = "sha256-2GAUHxK3dnDhXIftd2luxmn1b84ABZvfjHBMQWeDiTs="; + }; + installPhase = '' + mkdir -p $out + cp -R * $out/ + ''; + }) + (pkgs.stdenv.mkDerivation { + name = "commonmark"; + # Download the theme from the dokuwiki site + src = pkgs.fetchFromGitHub { + owner = "clockoon"; + repo = "dokuwiki-plugin-commonmark"; + rev = "v1.2.1"; + hash = "sha256-epqyrKlubDY/vq/1IWbPyuMwLZ2TcH47MPW0aywwiyE="; + }; + installPhase = '' + mkdir -p $out + cp -R * $out/ + ''; + }) + + ]; + templates = [ + (pkgs.stdenv.mkDerivation rec { + name = "bootstrap3"; + version = "2022-07-27"; + src = pkgs.fetchFromGitHub { + owner = "giterlizzi"; + repo = "dokuwiki-template-bootstrap3"; + rev = "v${version}"; + hash = "sha256-B3Yd4lxdwqfCnfmZdp+i/Mzwn/aEuZ0ovagDxuR6lxo="; + }; + installPhase = "mkdir -p $out; cp -R * $out/"; + }) + ]; + }; + }; + +} diff --git a/default.nix b/shared/dokuwiki.nix similarity index 100% rename from default.nix rename to shared/dokuwiki.nix