Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
nixos/apache-httpd/wordpress: copy plugins and themes instead of syml…
Browse files Browse the repository at this point in the history
…inking

Symlinking works for most plugins and themes, but Avada, for instance, fails to
understand the symlink, causing its file path stripping to fail. This results in
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.
  • Loading branch information
FPtje committed Jan 6, 2019
1 parent b27b443 commit 9d2c915
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nixos/modules/services/web-servers/apache-httpd/wordpress.nix
Expand Up @@ -85,10 +85,10 @@ let
# 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) }
# copy additional theme(s)
${concatMapStrings (theme: "cp -r ${theme} $out/wp-content/themes/${theme.name}\n") config.themes}
# copy additional plugin(s)
${concatMapStrings (plugin: "cp -r ${plugin} $out/wp-content/plugins/${plugin.name}\n") (config.plugins) }
# symlink additional translation(s)
mkdir -p $out/wp-content/languages
Expand Down

0 comments on commit 9d2c915

Please sign in to comment.