feat(wordpress): Add lavoixduntexte

Add the website lavoixduntexte, as well as wrappers to create addons easily
This commit is contained in:
Tom Hubrecht 2023-10-22 18:03:55 +02:00
parent 14b436f331
commit acc2ee6fef
4 changed files with 53 additions and 3 deletions

View 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);
}

View file

@ -0,0 +1,6 @@
{
wordpress-importer = {
version = "0.8.1";
hash = "sha256-vOgAFIapqGTFLMeH7xVPnfRKtKT+E7ToUkcz5/a9f8g=";
};
}

View file

@ -0,0 +1,6 @@
{
avant = {
version = "1.2.00";
hash = "sha256-xRLIfH5wkwpUtSP3IBtaZM0VCpE4/cwpfM1ypN4G+WE=";
};
}

View file

@ -1,9 +1,20 @@
_:
{ pkgs, lib, ... }:
let host = "lavoixduntexte.normalesup.eu";
let
host = "lavoixduntexte.normalesup.eu";
addons = import ./addons { inherit pkgs lib; };
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} = {
enableACME = true;