diff --git a/machines/web01/wordpress/addons/default.nix b/machines/web01/wordpress/addons/default.nix deleted file mode 100644 index 1e9f812..0000000 --- a/machines/web01/wordpress/addons/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ 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 deleted file mode 100644 index 493be0c..0000000 --- a/machines/web01/wordpress/addons/plugins.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - wordpress-importer = { - version = "0.8.1"; - hash = "sha256-vOgAFIapqGTFLMeH7xVPnfRKtKT+E7ToUkcz5/a9f8g="; - }; - user-role-editor = { - version = "4.64.1"; - hash = "sha256-ZOpeY0SMeL6jT6PbGWnGlTADYUY9eUufymfRBqvCVac="; - }; -} diff --git a/machines/web01/wordpress/addons/themes.nix b/machines/web01/wordpress/addons/themes.nix deleted file mode 100644 index a9c4eef..0000000 --- a/machines/web01/wordpress/addons/themes.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - avant = { - version = "1.2.00"; - hash = "sha256-xRLIfH5wkwpUtSP3IBtaZM0VCpE4/cwpfM1ypN4G+WE="; - }; -} diff --git a/machines/web01/wordpress/default.nix b/machines/web01/wordpress/default.nix index efe7a21..07399a1 100644 --- a/machines/web01/wordpress/default.nix +++ b/machines/web01/wordpress/default.nix @@ -1,6 +1,6 @@ -{ pkgs, lib, ... }: +{ pkgs, sources, ... }: -let addons = import ./addons { inherit pkgs lib; }; +let wp4nix = pkgs.callPackage sources.wp4nix { }; in { imports = [ ./module.nix ]; @@ -9,25 +9,25 @@ in { sites = { "lavoixduntexte.normalesup.eu" = { - themes = { inherit (addons.themes) avant; }; + themes = { inherit (wp4nix.themes) avant; }; - plugins = { inherit (addons.plugins) wordpress-importer; }; + plugins = { inherit (wp4nix.plugins) wordpress-importer; }; languages = [ pkgs.wordpressPackages.languages.fr_FR ]; }; "bds.wp.dgnum.eu" = { - plugins = { inherit (addons.plugins) user-role-editor; }; + plugins = { inherit (wp4nix.plugins) user-role-editor; }; languages = [ pkgs.wordpressPackages.languages.fr_FR ]; }; "bda.wp.dgnum.eu" = { - plugins = { inherit (addons.plugins) user-role-editor; }; + plugins = { inherit (wp4nix.plugins) user-role-editor; }; languages = [ pkgs.wordpressPackages.languages.fr_FR ]; }; "cineclub.wp.dgnum.eu" = { - plugins = { inherit (addons.plugins) user-role-editor; }; + plugins = { inherit (wp4nix.plugins) user-role-editor; }; languages = [ pkgs.wordpressPackages.languages.fr_FR ]; }; }; diff --git a/npins/sources.json b/npins/sources.json index 14e13b6..f516000 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -136,6 +136,18 @@ "url": "https://releases.nixos.org/nixpkgs/nixpkgs-24.05pre565199.63143ac2c918/nixexprs.tar.xz", "hash": "04k3q5224dnyn82yacbq9q9gnsrn6ig043mpzpsky885ikg7i2zw" }, + "wp4nix": { + "type": "Git", + "repository": { + "type": "GitLab", + "repo_path": "helsinki-systems/wp4nix", + "server": "https://git.helsinki.tools/" + }, + "branch": "master", + "revision": "9953928aaf564fe0bc952f4396b22132b7f9ff88", + "url": "https://git.helsinki.tools/api/v4/projects/helsinki-systems%2Fwp4nix/repository/archive.tar.gz?sha=9953928aaf564fe0bc952f4396b22132b7f9ff88", + "hash": "0da528r06765yb0gmc60iflh4xdj3gkf1v604y1a7irip4ydacra" + }, "www-eleves": { "type": "Git", "repository": {