nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitLab,
4 php,
5 nixosTests,
6 writeScript,
7}:
8
9php.buildComposerProject2 (finalAttrs: {
10 pname = "drupal";
11 version = "11.3.2";
12
13 src = fetchFromGitLab {
14 domain = "git.drupalcode.org";
15 owner = "project";
16 repo = "drupal";
17 tag = finalAttrs.version;
18 hash = "sha256-RrBnVDjB6aKW6btmX604saXfPKo18oRka+SdlNmFqUo=";
19 };
20
21 composerNoPlugins = false;
22 vendorHash = "sha256-c3pqPnyeuSqpMhh1an1NAnDC+IyeRVUT+dCN19/nrMQ=";
23
24 passthru = {
25 tests = {
26 inherit (nixosTests) drupal;
27 };
28 updateScript = writeScript "update.sh" ''
29 #!/usr/bin/env nix-shell
30 #!nix-shell -i bash -p nix-update xmlstarlet
31
32 set -eu -o pipefail
33
34 version=$(curl -k --silent --globoff "https://updates.drupal.org/release-history/drupal/current" | xmlstarlet sel -t -v "/project/releases/release/tag[not(contains(., 'alpha'))][not(contains(., 'beta'))][not(contains(., '-rc'))]" | grep -m 1 '.')
35
36 nix-update drupal --version $version
37 '';
38 };
39
40 meta = {
41 description = "Drupal CMS";
42 license = lib.licenses.mit;
43 homepage = "https://drupal.org/";
44 maintainers = with lib.maintainers; [
45 OulipianSummer
46 ];
47 platforms = php.meta.platforms;
48 };
49})