diff --git a/machines/web01/wordpress/addons/default.nix b/machines/web01/wordpress/addons/default.nix new file mode 100644 index 0000000..1e9f812 --- /dev/null +++ b/machines/web01/wordpress/addons/default.nix @@ -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); +} diff --git a/machines/web01/wordpress/addons/plugins.nix b/machines/web01/wordpress/addons/plugins.nix new file mode 100644 index 0000000..e5d989e --- /dev/null +++ b/machines/web01/wordpress/addons/plugins.nix @@ -0,0 +1,6 @@ +{ + wordpress-importer = { + version = "0.8.1"; + hash = "sha256-vOgAFIapqGTFLMeH7xVPnfRKtKT+E7ToUkcz5/a9f8g="; + }; +} diff --git a/machines/web01/wordpress/addons/themes.nix b/machines/web01/wordpress/addons/themes.nix new file mode 100644 index 0000000..a9c4eef --- /dev/null +++ b/machines/web01/wordpress/addons/themes.nix @@ -0,0 +1,6 @@ +{ + avant = { + version = "1.2.00"; + hash = "sha256-xRLIfH5wkwpUtSP3IBtaZM0VCpE4/cwpfM1ypN4G+WE="; + }; +} diff --git a/machines/web01/wordpress/lavoixduntexte.nix b/machines/web01/wordpress/lavoixduntexte.nix index b0a0538..bebe295 100644 --- a/machines/web01/wordpress/lavoixduntexte.nix +++ b/machines/web01/wordpress/lavoixduntexte.nix @@ -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;