Commit b8818692 authored by Jonas Heinrich's avatar Jonas Heinrich Committed by Yt
Browse files

nixos/wordpress: Add language support

parent 7f3b66af
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -767,6 +767,13 @@
          grants access to the hardware.
        </para>
      </listitem>
      <listitem>
        <para>
          The Wordpress module got support for installing language packs
          through
          <literal>services.wordpress.sites.&lt;site&gt;.languages</literal>.
        </para>
      </listitem>
      <listitem>
        <para>
          There is a new module for the <literal>thunar</literal>
+2 −0
Original line number Diff line number Diff line
@@ -254,6 +254,8 @@ Available as [services.patroni](options.html#opt-services.patroni.enable).

- There is a new module for AMD SEV CPU functionality, which grants access to the hardware.

- The Wordpress module got support for installing language packs through `services.wordpress.sites.<site>.languages`.

- There is a new module for the `thunar` program (the Xfce file manager), which depends on the `xfconf` dbus service, and also has a dbus service and a systemd unit. The option `services.xserver.desktopManager.xfce.thunarPlugins` has been renamed to `programs.thunar.plugins`, and in a future release it may be removed.

- There is a new module for the `xfconf` program (the Xfce configuration storage system), which has a dbus service.
+28 −1
Original line number Diff line number Diff line
@@ -30,9 +30,10 @@ let
      # requests that look like: https://example.com/wp-content//nix/store/...plugin/path/some-file.js
      # Since hard linking directories is not allowed, copying is the next best thing.

      # copy additional plugin(s) and theme(s)
      # copy additional plugin(s), theme(s) and language(s)
      ${concatMapStringsSep "\n" (theme: "cp -r ${theme} $out/share/wordpress/wp-content/themes/${theme.name}") cfg.themes}
      ${concatMapStringsSep "\n" (plugin: "cp -r ${plugin} $out/share/wordpress/wp-content/plugins/${plugin.name}") cfg.plugins}
      ${concatMapStringsSep "\n" (language: "cp -r ${language} $out/share/wordpress/wp-content/languages/") cfg.languages}
    '';
  };

@@ -154,6 +155,32 @@ let
          '';
        };

        languages = mkOption {
          type = types.listOf types.path;
          default = [];
          description = lib.mdDoc ''
            List of path(s) to respective language(s) which are copied from the 'languages' directory.
          '';
          example = literalExpression ''
            [(
              # Let's package the German language.
              # For other languages try to replace language and country code in the download URL with your desired one.
              # Reference https://translate.wordpress.org for available translations and
              # codes.
              language-de = pkgs.stdenv.mkDerivation {
                name = "language-de";
                src = pkgs.fetchurl {
                  url = "https://de.wordpress.org/wordpress-''${pkgs.wordpress.version}-de_DE.tar.gz";
                  # Name is required to invalidate the hash when wordpress is updated
                  name = "wordpress-''${pkgs.wordpress.version}-language-de"
                  sha256 = "sha256-dlas0rXTSV4JAl8f/UyMbig57yURRYRhTMtJwF9g8h0=";
                };
                installPhase = "mkdir -p $out; cp -r ./wp-content/languages/* $out/";
              };
            )];
          '';
        };

        database = {
          host = mkOption {
            type = types.str;