anchor.diff:        type = types.listOf types.path;
         description =
           ''
  -          List of path(s) to respective theme(s) which are symlinked from the 'theme' directory. Note: These themes need to be packaged before use.
  +          List of path(s) to respective theme(s) which are symlinked from the 'theme' directory. Note: These themes need to be packaged before use, see example.
           '';
         example = ''
           # For shits and giggles, let's package the responsive theme
  
positive.code:       type = types.listOf types.path;
        description =
          ''
            List of path(s) to respective plugin(s) which are symlinked from the 'plugins' directory. Note: These plugins need to be packaged before use.
          '';
        example = ''
          # Wordpress plugin 'akismet' installation example
  
negative.code:     <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /
      RewriteRule ^index\.php$ - [L]
  
      # add a trailing slash to /wp-admin
      RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
  
      RewriteCond %{REQUEST_FILENAME} -f [OR]
      RewriteCond %{REQUEST_FILENAME} -d
      RewriteRule ^ - [L]
      RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
      RewriteRule ^(.*\.php)$ $1 [L]
      RewriteRule . index.php [L]
      </IfModule>
    '';
  
    # WP translation can be found here:
    #   https://make.wordpress.org/polyglots/teams/
    # FIXME: 
    #  - add all these languages: 
    #    sq ar az eu bs bg ca zh-cn zh-tw hr da nl en-au 
    #    en-ca en-gb eo fi fr gl de el he hu is id it ja 
    #    ko lt nb nn oci pl pt-br pt ro ru sr sk es-mx es 
    #    sv th tr uk cy
    #  - cache the files on github.com/qknight/WordpressLanguages and use fetchFromGithub instead
    #    note: this implementation of supportedLanguages will only work for me (qknight) as i'm using nix-prefetch-url
    #          as the sha256 changes like every download. 
    # note: this is also true for plugins and themes but these are controlled not from withing wordpress.nix
    supportedLanguages = {
      en_GB = "1yf1sb6ji3l4lg8nkkjhckbwl81jly8z93jf06pvk6a1p6bsr6l6";
      de_DE = "3881221f337799b88f9562df8b3f1560f2c49a8f662297561a5b25ce77f22e17";
    };
  
    downloadLanguagePack = language: sha256:
      pkgs.stdenv.mkDerivation rec {
        name = "wp_${language}-${version}";
        src = pkgs.fetchurl {
          url = "https://downloads.wordpress.org/translation/core/${version}/${language}.zip";
          sha256 = "${sha256}";
        };
        buildInputs = [ pkgs.unzip ];
        unpackPhase = ''
          unzip $src
          export sourceRoot=.
        '';
        installPhase = "mkdir -p $out; cp -R * $out/";
      };
  
    selectedLanguages = map (lang: downloadLanguagePack lang supportedLanguages.${lang}) (config.languages);
  
    # The wordpress package itself
    wordpressRoot = pkgs.stdenv.mkDerivation rec {
      name = "wordpress";
      src = pkgs.fetchFromGitHub {
        owner = "WordPress";
        repo = "WordPress";
        rev = "${fullversion}";
        sha256 = "0gq1j9b0d0rykql3jzdb2yn4adj0rrcsvqrmj3dzx11ir57ilsgc";
      };
      installPhase = ''
        mkdir -p $out
        # copy all the wordpress files we downloaded
        cp -R * $out/
  
        # symlink the wordpress config
        ln -s ${wordpressConfig} $out/wp-config.php
        # symlink custom .htaccess
        ln -s ${htaccess} $out/.htaccess
        # symlink uploads directory
        ln -s ${config.wordpressUploads} $out/wp-content/uploads
  
        # remove bundled plugins(s) coming with wordpress
        rm -Rf $out/wp-content/plugins/*
        # remove bundled themes(s) coming with wordpress
        rm -Rf $out/wp-content/themes/*
  
        # symlink additional theme(s)
        ${concatMapStrings (theme: "ln -s ${theme} $out/wp-content/themes/${theme.name}\n") config.themes}
        # symlink additional plugin(s)
        ${concatMapStrings (plugin: "ln -s ${plugin} $out/wp-content/plugins/${plugin.name}\n") (config.plugins) }
  
        # symlink additional translation(s) 
        mkdir -p $out/wp-content/languages
        ${concatMapStrings (language: "ln -s ${language}/*.mo ${language}/*.po $out/wp-content/languages/\n") (selectedLanguages) }
      '';
    };
  
  