forked from DGNum/infrastructure
feat(wordpress): Add lavoixduntexte
Add the website lavoixduntexte, as well as wrappers to create addons easily
This commit is contained in:
parent
14b436f331
commit
acc2ee6fef
4 changed files with 53 additions and 3 deletions
27
machines/web01/wordpress/addons/default.nix
Normal file
27
machines/web01/wordpress/addons/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
mkWordpressAddon = { name, version, type, hash ? lib.fakeHash }:
|
||||||
|
pkgs.stdenv.mkDerivation {
|
||||||
|
inherit name version;
|
||||||
|
|
||||||
|
src = pkgs.fetchzip {
|
||||||
|
url = "https://downloads.wordpress.org/${type}/${name}.${version}.zip";
|
||||||
|
inherit hash;
|
||||||
|
};
|
||||||
|
|
||||||
|
installPhase = "mkdir -p $out; cp -R * $out/";
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
themes = builtins.mapAttrs (name: attrs:
|
||||||
|
mkWordpressAddon ({
|
||||||
|
inherit name;
|
||||||
|
type = "theme";
|
||||||
|
} // attrs)) (import ./themes.nix);
|
||||||
|
|
||||||
|
plugins = builtins.mapAttrs (name: attrs:
|
||||||
|
mkWordpressAddon ({
|
||||||
|
inherit name;
|
||||||
|
type = "plugin";
|
||||||
|
} // attrs)) (import ./plugins.nix);
|
||||||
|
}
|
6
machines/web01/wordpress/addons/plugins.nix
Normal file
6
machines/web01/wordpress/addons/plugins.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
wordpress-importer = {
|
||||||
|
version = "0.8.1";
|
||||||
|
hash = "sha256-vOgAFIapqGTFLMeH7xVPnfRKtKT+E7ToUkcz5/a9f8g=";
|
||||||
|
};
|
||||||
|
}
|
6
machines/web01/wordpress/addons/themes.nix
Normal file
6
machines/web01/wordpress/addons/themes.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
avant = {
|
||||||
|
version = "1.2.00";
|
||||||
|
hash = "sha256-xRLIfH5wkwpUtSP3IBtaZM0VCpE4/cwpfM1ypN4G+WE=";
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,9 +1,20 @@
|
||||||
_:
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
let host = "lavoixduntexte.normalesup.eu";
|
let
|
||||||
|
host = "lavoixduntexte.normalesup.eu";
|
||||||
|
|
||||||
|
addons = import ./addons { inherit pkgs lib; };
|
||||||
in {
|
in {
|
||||||
services.wordpress.sites.${host} = { database.tablePrefix = "wp_lvdt_"; };
|
services.wordpress.sites.${host} = {
|
||||||
|
themes = { inherit (addons.themes) avant; };
|
||||||
|
plugins = { inherit (addons.plugins) wordpress-importer; };
|
||||||
|
|
||||||
|
languages = [ pkgs.wordpressPackages.languages.fr_FR ];
|
||||||
|
|
||||||
|
database.tablePrefix = "wp_lvdt_";
|
||||||
|
|
||||||
|
settings = { };
|
||||||
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts.${host} = {
|
services.nginx.virtualHosts.${host} = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
|
|
Loading…
Reference in a new issue