diff --git a/nixos/modules/services/web-apps/discourse.nix b/nixos/modules/services/web-apps/discourse.nix
index d3ae072f86a8..8d5302ba267b 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 bae562423213..1d6866e7b352 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 = {