From 20548f050e72a789ebbfe413b0fe7aa815e55c27 Mon Sep 17 00:00:00 2001 From: talyz Date: Tue, 6 Jul 2021 18:37:00 +0200 Subject: nixos/discourse: Update plugin documentation Update the documentation regarding plugins to reflect recent changes. --- nixos/modules/services/web-apps/discourse.nix | 19 +++++------- nixos/modules/services/web-apps/discourse.xml | 43 ++++++++++++++++++++------- 2 files changed, 39 insertions(+), 23 deletions(-) (limited to 'nixos/modules') diff --git a/nixos/modules/services/web-apps/discourse.nix b/nixos/modules/services/web-apps/discourse.nix index d3ae072f86a..8d5302ba267 100644 --- a/nixos/modules/services/web-apps/discourse.nix +++ b/nixos/modules/services/web-apps/discourse.nix @@ -475,21 +475,16 @@ in plugins = lib.mkOption { type = lib.types.listOf lib.types.package; default = []; - example = '' - [ - (pkgs.fetchFromGitHub { - owner = "discourse"; - repo = "discourse-spoiler-alert"; - rev = "e200cfa571d252cab63f3d30d619b370986e4cee"; - sha256 = "0ya69ix5g77wz4c9x9gmng6l25ghb5xxlx3icr6jam16q14dzc33"; - }) + example = lib.literalExample '' + with config.services.discourse.package.plugins; [ + discourse-canned-replies + discourse-github ]; ''; description = '' - Discourse plugins to install as a - list of derivations. As long as a plugin supports the - standard install method, packaging it should only require - fetching its source with an appropriate fetcher. + Plugins to install as part of + Discourse, expressed as a list of + derivations. ''; }; diff --git a/nixos/modules/services/web-apps/discourse.xml b/nixos/modules/services/web-apps/discourse.xml index bae56242321..1d6866e7b35 100644 --- a/nixos/modules/services/web-apps/discourse.xml +++ b/nixos/modules/services/web-apps/discourse.xml @@ -262,9 +262,31 @@ services.discourse = { You can install Discourse plugins using the - option. As long as a plugin supports the standard install - method, packaging it should only require fetching its source - with an appropriate fetcher. + option. Pre-packaged plugins are provided in + <your_discourse_package_here>.plugins. If + you want the full suite of plugins provided through + nixpkgs, you can also set the option to + pkgs.discourseAllPlugins. + + + + Plugins can be built with the + <your_discourse_package_here>.mkDiscoursePlugin + function. Normally, it should suffice to provide a + name and src attribute. If + the plugin has Ruby dependencies, however, they need to be + packaged in accordance with the Developing + with Ruby section of the Nixpkgs manual and the + appropriate gem options set in bundlerEnvArgs + (normally gemdir is sufficient). A plugin's + Ruby dependencies are listed in its + plugin.rb file as function calls to + gem. To construct the corresponding + Gemfile, run bundle + init, then add the gem lines to it + verbatim. @@ -280,7 +302,10 @@ services.discourse = { For example, to add the discourse-spoiler-alert - plugin and disable it by default: + and discourse-solved + plugins, and disable discourse-spoiler-alert + by default: services.discourse = { @@ -301,13 +326,9 @@ services.discourse = { passwordFile = "/path/to/smtp_password_file"; }; mail.incoming.enable = true; - plugins = [ - (pkgs.fetchFromGitHub { - owner = "discourse"; - repo = "discourse-spoiler-alert"; - rev = "e200cfa571d252cab63f3d30d619b370986e4cee"; - sha256 = "0ya69ix5g77wz4c9x9gmng6l25ghb5xxlx3icr6jam16q14dzc33"; - }) + plugins = with config.services.discourse.package.plugins; [ + discourse-spoiler-alert + discourse-solved ]; siteSettings = { plugins = { -- cgit 1.4.1