{ "uuid": [ { "value": "ebcaf7c3-e103-448b-aa74-6bb469be0c2d" } ], "langcode": [ { "value": "en" } ], "type": [ { "target_id": "daily_email", "target_type": "node_type", "target_uuid": "8bde1f2f-eef9-4f2d-ae9c-96921f8193d7" } ], "revision_timestamp": [ { "value": "2025-05-11T09:00:02+00:00" } ], "revision_uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "revision_log": [], "status": [ { "value": true } ], "uid": [ { "target_type": "user", "target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849" } ], "title": [ { "value": "Minimum viable development environment" } ], "created": [ { "value": "2025-01-19T00:00:00+00:00" } ], "changed": [ { "value": "2025-05-11T09:00:02+00:00" } ], "promote": [ { "value": false } ], "sticky": [ { "value": false } ], "default_langcode": [ { "value": true } ], "revision_translation_affected": [ { "value": true } ], "path": [ { "alias": "\/daily\/2025\/01\/19\/minimum-viable-development-environment", "langcode": "en" } ], "body": [ { "value": "\n

What is the leanest and most minimal local environment for software development?<\/p>\n\n

I think if you use Linux, the most minimal approach is to install the packages you need, such as PHP and MySQL directly in your operating system.<\/p>\n\n

There's no overhead or complexity added by tools like containers so things will run as quick and efficiently as possible.<\/p>\n\n

This is great if you only work on one project and you can easily keep your installation in sync with production.<\/p>\n\n

But what if you work on multiple projects or with a team of Developers?<\/p>\n\n

You need a way for everyone to have the same software and package versions, and to be able to configure them for each project.<\/p>\n\n

These are the reasons why tools like Vagrant, Docker and Podman became popular, as they made it possible for environments to be easily repeatable and customisable.<\/p>\n\n

What about Nix?<\/h2>\n\n

Another tool that can be used to install software is Nix - a package manager with over 100,000 software packages.<\/p>\n\n

I can use it to install the required software for each project and share the files with any team members so they have the same configuration.<\/p>\n\n

This is the flake.nix<\/code> file that I've been testing with a Drupal codebase:<\/p>\n\n

{\n  inputs.nixpkgs.url = \"github:nixos\/nixpkgs\/nixos-unstable\";\n\n  outputs =\n    { nixpkgs, ... }:\n    let\n      system = \"x86_64-linux\";\n      pkgs = nixpkgs.legacyPackages.${system};\n    in\n    {\n      devShells.${system}.default = pkgs.mkShell {\n        buildInputs = with pkgs; [\n          mariadb\n          php82\n          php82Packages.composer\n        ];\n      };\n    };\n}\n<\/code><\/pre>\n\n

This installs PHP 8.2, Composer and MariaDB, and nothing else.<\/p>\n\n

It also generates a flake.lock<\/code> file so everyone gets exactly the same package versions.<\/p>\n\n

The downside is that, if everyone isn't using NixOS which handles services, I need to configure the database server for each project, running commands like mysql_install_db<\/code> and mysqld<\/code> before creating the database and user to put in the settings.php<\/code> file.<\/p>\n\n

It's not complicated but devenv is a great option<\/a> if you want something more fully featured and opinionated that does more out of the box.<\/p>\n\n

Once the database server is running and Drupal is installed, I can run drush runserver<\/code> to run the website - no need for Apache, Caddy or Nginx.<\/p>\n\n

If you want to see another example, see the flake.nix file for this website<\/a>.<\/p>\n\n ", "format": "full_html", "processed": "\n

What is the leanest and most minimal local environment for software development?<\/p>\n\n

I think if you use Linux, the most minimal approach is to install the packages you need, such as PHP and MySQL directly in your operating system.<\/p>\n\n

There's no overhead or complexity added by tools like containers so things will run as quick and efficiently as possible.<\/p>\n\n

This is great if you only work on one project and you can easily keep your installation in sync with production.<\/p>\n\n

But what if you work on multiple projects or with a team of Developers?<\/p>\n\n

You need a way for everyone to have the same software and package versions, and to be able to configure them for each project.<\/p>\n\n

These are the reasons why tools like Vagrant, Docker and Podman became popular, as they made it possible for environments to be easily repeatable and customisable.<\/p>\n\n

What about Nix?<\/h2>\n\n

Another tool that can be used to install software is Nix - a package manager with over 100,000 software packages.<\/p>\n\n

I can use it to install the required software for each project and share the files with any team members so they have the same configuration.<\/p>\n\n

This is the flake.nix<\/code> file that I've been testing with a Drupal codebase:<\/p>\n\n

{\n  inputs.nixpkgs.url = \"github:nixos\/nixpkgs\/nixos-unstable\";\n\n  outputs =\n    { nixpkgs, ... }:\n    let\n      system = \"x86_64-linux\";\n      pkgs = nixpkgs.legacyPackages.${system};\n    in\n    {\n      devShells.${system}.default = pkgs.mkShell {\n        buildInputs = with pkgs; [\n          mariadb\n          php82\n          php82Packages.composer\n        ];\n      };\n    };\n}\n<\/code><\/pre>\n\n

This installs PHP 8.2, Composer and MariaDB, and nothing else.<\/p>\n\n

It also generates a flake.lock<\/code> file so everyone gets exactly the same package versions.<\/p>\n\n

The downside is that, if everyone isn't using NixOS which handles services, I need to configure the database server for each project, running commands like mysql_install_db<\/code> and mysqld<\/code> before creating the database and user to put in the settings.php<\/code> file.<\/p>\n\n

It's not complicated but devenv is a great option<\/a> if you want something more fully featured and opinionated that does more out of the box.<\/p>\n\n

Once the database server is running and Drupal is installed, I can run drush runserver<\/code> to run the website - no need for Apache, Caddy or Nginx.<\/p>\n\n

If you want to see another example, see the flake.nix file for this website<\/a>.<\/p>\n\n ", "summary": null } ] }