feat(wordpress): Switch to wp4nix for plugins and themes

This commit is contained in:
Tom Hubrecht 2024-01-09 15:51:36 +01:00
parent 4716f8a398
commit 8ddd33d88d
5 changed files with 19 additions and 50 deletions

View file

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

View file

@ -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=";
};
}

View file

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

View file

@ -1,6 +1,6 @@
{ pkgs, lib, ... }: { pkgs, sources, ... }:
let addons = import ./addons { inherit pkgs lib; }; let wp4nix = pkgs.callPackage sources.wp4nix { };
in { in {
imports = [ ./module.nix ]; imports = [ ./module.nix ];
@ -9,25 +9,25 @@ in {
sites = { sites = {
"lavoixduntexte.normalesup.eu" = { "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 ]; languages = [ pkgs.wordpressPackages.languages.fr_FR ];
}; };
"bds.wp.dgnum.eu" = { "bds.wp.dgnum.eu" = {
plugins = { inherit (addons.plugins) user-role-editor; }; plugins = { inherit (wp4nix.plugins) user-role-editor; };
languages = [ pkgs.wordpressPackages.languages.fr_FR ]; languages = [ pkgs.wordpressPackages.languages.fr_FR ];
}; };
"bda.wp.dgnum.eu" = { "bda.wp.dgnum.eu" = {
plugins = { inherit (addons.plugins) user-role-editor; }; plugins = { inherit (wp4nix.plugins) user-role-editor; };
languages = [ pkgs.wordpressPackages.languages.fr_FR ]; languages = [ pkgs.wordpressPackages.languages.fr_FR ];
}; };
"cineclub.wp.dgnum.eu" = { "cineclub.wp.dgnum.eu" = {
plugins = { inherit (addons.plugins) user-role-editor; }; plugins = { inherit (wp4nix.plugins) user-role-editor; };
languages = [ pkgs.wordpressPackages.languages.fr_FR ]; languages = [ pkgs.wordpressPackages.languages.fr_FR ];
}; };
}; };

View file

@ -136,6 +136,18 @@
"url": "https://releases.nixos.org/nixpkgs/nixpkgs-24.05pre565199.63143ac2c918/nixexprs.tar.xz", "url": "https://releases.nixos.org/nixpkgs/nixpkgs-24.05pre565199.63143ac2c918/nixexprs.tar.xz",
"hash": "04k3q5224dnyn82yacbq9q9gnsrn6ig043mpzpsky885ikg7i2zw" "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": { "www-eleves": {
"type": "Git", "type": "Git",
"repository": { "repository": {