Install other flavors of Drupal besides just Drupal CMS

Created on 2 August 2025, 14 days ago

Problem/Motivation

The #demo flake target always downloads and installs the latest Drupal CMS release. To make this more generally useful as a development tool, it should be possible to specify other packages, such as drupal/recommended-project.

Proposed resolution

Add two new arguments for the #demo target script: package, and site name. Or, create a new #install target for this.

The command, when finished, can be something along these lines:

nix run .#install -- drupal/core-recommended:^11.2 my-new-project

... This would install Drupal core recommended, and set the PROJECT_NAME=my-new-project in the .env file.

nix run .#install -- phenaproxima/xb-demo xb-demo --stability=dev

... This would install the current (August 2025) Experience Builder demo, with a project name of xb-demo.

Remaining tasks

Add #install target, configure script to take arguments of and
, and pass any parameters through to the composer create-project command.

Possibly add a --php parameter to specify a php version to add to the .env file.

If the current directory is in git, automatically add the .env file so the flake reads it correctly.

User interface changes

I'm thinking now that we'll add arguments to both targets -- .#demo and .#install. .#demo will do the composer installation, and then a drush site:install, and then open the browser, preserving our ability to do a one-liner demo.

.#install will do the composer install only, and then you can run drush site:install yourself from there, or simply go through the browser installation.

API changes

Data model changes

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States freelock Seattle

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @freelock
  • πŸ‡ΊπŸ‡ΈUnited States freelock Seattle

    Added some options to the nix run .#demo target, along with the start-demo script.

    You can now pass a package name, project name, and composer args to the start-demo script to install packages for other site templates/projects. This does support the one-line approach, though to do anything further with the project (such as use drush, etc) you will need to install the flake to get the appropriate environment.

    For example:

    One-liner to start XB Demo

    Make a new directory and cd into it, and then run this command:

    nix run github:freelock/drupal-flake#demo -- phenaproxima/xb-demo xb-demo --stability=dev

    On my laptop that takes between 2 - 3 minutes to run before it opens a browser window with the Experience Builder demo loaded up. At the end of the "cms" job in your terminal window, it prints the admin username and password you can enter at /user, and then the dashboard shows the XB page you can open and edit, and you're in Experience Builder!

    Start a new project from this point

    The one-liner is a slick demo trick, but to continue development on a new project, you need the nix flake installed. You can do this after running the one-liner, but you might need to reinstall to use a different project name. Installing the flake first gives you more options:

    nix flake init -t github:freelock/drupal-flake
    direnv allow (if you have Direnv installed), or
    nix develop (if you don't have Direnv available)

    ... Then you can use the start-demo script to install/configure a project:

    start-demo drupal/core-recommended my-new-project

    • freelock β†’ committed be9141bb on 1.0.x
      [#3539436] feat: Install other flavors of Drupal besides just Drupal CMS...
Production build 0.71.5 2024