···354 </listitem>
355 <listitem>
356 <para>
00000000000357 In <literal>mastodon</literal> it is now necessary to specify
358 location of file with <literal>PostgreSQL</literal> database
359 password. In
···354 </listitem>
355 <listitem>
356 <para>
357+ The
358+ <link linkend="opt-services.wordpress.sites._name_.plugins">services.wordpress.sites.<name>.plugins</link>
359+ and
360+ <link linkend="opt-services.wordpress.sites._name_.themes">services.wordpress.sites.<name>.themes</link>
361+ options have been converted from sets to attribute sets to
362+ allow for consumers to specify explicit install paths via
363+ attribute name.
364+ </para>
365+ </listitem>
366+ <listitem>
367+ <para>
368 In <literal>mastodon</literal> it is now necessary to specify
369 location of file with <literal>PostgreSQL</literal> database
370 password. In
+2
nixos/doc/manual/release-notes/rl-2305.section.md
···8788- Qt 5.12 and 5.14 have been removed, as the corresponding branches have been EOL upstream for a long time. This affected under 10 packages in nixpkgs, largely unmaintained upstream as well, however, out-of-tree package expressions may need to be updated manually.
890090- In `mastodon` it is now necessary to specify location of file with `PostgreSQL` database password. In `services.mastodon.database.passwordFile` parameter default value `/var/lib/mastodon/secrets/db-password` has been changed to `null`.
9192- The `--target-host` and `--build-host` options of `nixos-rebuild` no longer treat the `localhost` value specially – to build on/deploy to local machine, omit the relevant flag.
···8788- Qt 5.12 and 5.14 have been removed, as the corresponding branches have been EOL upstream for a long time. This affected under 10 packages in nixpkgs, largely unmaintained upstream as well, however, out-of-tree package expressions may need to be updated manually.
8990+- The [services.wordpress.sites.<name>.plugins](#opt-services.wordpress.sites._name_.plugins) and [services.wordpress.sites.<name>.themes](#opt-services.wordpress.sites._name_.themes) options have been converted from sets to attribute sets to allow for consumers to specify explicit install paths via attribute name.
91+92- In `mastodon` it is now necessary to specify location of file with `PostgreSQL` database password. In `services.mastodon.database.passwordFile` parameter default value `/var/lib/mastodon/secrets/db-password` has been changed to `null`.
9394- The `--target-host` and `--build-host` options of `nixos-rebuild` no longer treat the `localhost` value specially – to build on/deploy to local machine, omit the relevant flag.
+22-40
nixos/modules/services/web-apps/wordpress.nix
···32 # Since hard linking directories is not allowed, copying is the next best thing.
3334 # copy additional plugin(s), theme(s) and language(s)
35- ${concatMapStringsSep "\n" (theme: "cp -r ${theme} $out/share/wordpress/wp-content/themes/${theme.name}") cfg.themes}
36- ${concatMapStringsSep "\n" (plugin: "cp -r ${plugin} $out/share/wordpress/wp-content/plugins/${plugin.name}") cfg.plugins}
37 ${concatMapStringsSep "\n" (language: "cp -r ${language} $out/share/wordpress/wp-content/languages/") cfg.languages}
38 '';
39 };
···130 };
131132 plugins = mkOption {
133- type = types.listOf types.path;
134- default = [];
0000135 description = lib.mdDoc ''
136- List of path(s) to respective plugin(s) which are copied from the 'plugins' directory.
137138 ::: {.note}
139 These plugins need to be packaged before use, see example.
140 :::
141 '';
142 example = literalExpression ''
143- let
144- # Wordpress plugin 'embed-pdf-viewer' installation example
145- embedPdfViewerPlugin = pkgs.stdenv.mkDerivation {
146- name = "embed-pdf-viewer-plugin";
147- # Download the theme from the wordpress site
148- src = pkgs.fetchurl {
149- url = "https://downloads.wordpress.org/plugin/embed-pdf-viewer.2.0.3.zip";
150- sha256 = "1rhba5h5fjlhy8p05zf0p14c9iagfh96y91r36ni0rmk6y891lyd";
151- };
152- # We need unzip to build this package
153- nativeBuildInputs = [ pkgs.unzip ];
154- # Installing simply means copying all files to the output directory
155- installPhase = "mkdir -p $out; cp -R * $out/";
156- };
157- # And then pass this theme to the themes list like this:
158- in [ embedPdfViewerPlugin ]
159 '';
160 };
161162 themes = mkOption {
163- type = types.listOf types.path;
164- default = [];
0000165 description = lib.mdDoc ''
166- List of path(s) to respective theme(s) which are copied from the 'theme' directory.
167168 ::: {.note}
169 These themes need to be packaged before use, see example.
170 :::
171 '';
172 example = literalExpression ''
173- let
174- # Let's package the responsive theme
175- responsiveTheme = pkgs.stdenv.mkDerivation {
176- name = "responsive-theme";
177- # Download the theme from the wordpress site
178- src = pkgs.fetchurl {
179- url = "https://downloads.wordpress.org/theme/responsive.3.14.zip";
180- sha256 = "0rjwm811f4aa4q43r77zxlpklyb85q08f9c8ns2akcarrvj5ydx3";
181- };
182- # We need unzip to build this package
183- nativeBuildInputs = [ pkgs.unzip ];
184- # Installing simply means copying all files to the output directory
185- installPhase = "mkdir -p $out; cp -R * $out/";
186- };
187- # And then pass this theme to the themes list like this:
188- in [ responsiveTheme ]
189 '';
190 };
191
···32 # Since hard linking directories is not allowed, copying is the next best thing.
3334 # copy additional plugin(s), theme(s) and language(s)
35+ ${concatStringsSep "\n" (mapAttrsToList (name: theme: "cp -r ${theme} $out/share/wordpress/wp-content/themes/${name}") cfg.themes)}
36+ ${concatStringsSep "\n" (mapAttrsToList (name: plugin: "cp -r ${plugin} $out/share/wordpress/wp-content/plugins/${name}") cfg.plugins)}
37 ${concatMapStringsSep "\n" (language: "cp -r ${language} $out/share/wordpress/wp-content/languages/") cfg.languages}
38 '';
39 };
···130 };
131132 plugins = mkOption {
133+ type = with types; coercedTo
134+ (listOf path)
135+ (l: warn "setting this option with a list is deprecated"
136+ listToAttrs (map (p: nameValuePair (p.name or (throw "${p} does not have a name")) p) l))
137+ (attrsOf path);
138+ default = {};
139 description = lib.mdDoc ''
140+ Path(s) to respective plugin(s) which are copied from the 'plugins' directory.
141142 ::: {.note}
143 These plugins need to be packaged before use, see example.
144 :::
145 '';
146 example = literalExpression ''
147+ {
148+ inherit (pkgs.wordpressPackages.plugins) embed-pdf-viewer-plugin;
149+ }
0000000000000150 '';
151 };
152153 themes = mkOption {
154+ type = with types; coercedTo
155+ (listOf path)
156+ (l: warn "setting this option with a list is deprecated"
157+ listToAttrs (map (p: nameValuePair (p.name or (throw "${p} does not have a name")) p) l))
158+ (attrsOf path);
159+ default = {};
160 description = lib.mdDoc ''
161+ Path(s) to respective theme(s) which are copied from the 'theme' directory.
162163 ::: {.note}
164 These themes need to be packaged before use, see example.
165 :::
166 '';
167 example = literalExpression ''
168+ {
169+ inherit (pkgs.wordpressPackages.themes) responsive-theme;
170+ }
0000000000000171 '';
172 };
173