From bfb67e4010e9e27dbf3a0d1ba9db1de707b408f1 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 25 Sep 2025 18:00:00 +0100 Subject: [PATCH] Updates for unified.diff --- nix-for-php-developers/slides.md | 124 ++++++++++++++++++++++++++----- 1 file changed, 104 insertions(+), 20 deletions(-) diff --git a/nix-for-php-developers/slides.md b/nix-for-php-developers/slides.md index 38a6e25..0e8adfb 100644 --- a/nix-for-php-developers/slides.md +++ b/nix-for-php-developers/slides.md @@ -4,7 +4,7 @@ footer: oliverdavies.uk --- @@ -36,17 +36,48 @@ https://www.oliverdavies.uk --- + + +# Nix for ~~PHP Developers~~ everyone + +
+
+ +Oliver Davies (opdavies) + +https://www.oliverdavies.uk + + + + + +--- + # About Me -- PHP since 2007. -- Drupal since 2008. -- Full-time Linux since ~2015. -- Nix/NixOS since 2022. +- PHP since 2007 +- Drupal since 2008 +- Full-time Linux since ~2015 +- Nix/NixOS since 2022 +- Gave my first presentation at unified.diff in September 2012 --- @@ -153,6 +184,15 @@ Ecosystem of tools. Home Manager for user home configuration, nix-darwin for man --- +# What is Nix? + +- Package manager +- Build tool +- Operating system +- Language + +--- + ![](./nix-search.png) + --- # Running PHP with Nix ```shell -$ nix run nixpkgs#php \ - --extra-experimental-features 'nix-command flakes' \ - -- -v +$ nix run nixpkgs#php -- -v -PHP 8.4.11 (cli) (built: Jul 29 2025 15:30:21) +PHP 8.4.11 ``` ```shell -$ nix shell nixpkgs#php \ - --extra-experimental-features 'nix-command flakes' +$ nix shell nixpkgs#php $ which php /nix/store/s4kv9bzqawhqcyjg9xm2hji3jap6d6kd-php-with-extensions-8.4.11/bin/php $ php -v -PHP 8.4.11 (cli) (built: Jul 29 2025 15:30:21) +PHP 8.4.11 ``` + --- # My ideal environment @@ -598,13 +663,13 @@ $ cd ~/my-project $ php -v -PHP 8.4.10 (cli) (built: Jul 2 2025 02:22:42) +PHP 8.4.10 $ cd ~/another-project $ php -v -PHP 8.3.24 (cli) (built: Jul 29 2025 15:48:33) +PHP 8.3.24 ``` --- @@ -717,6 +782,10 @@ php.buildComposerProject2 (finalAttrs: { # ... ``` + + --- # Packaging PHP for Nix @@ -763,7 +832,6 @@ nix build └── index.md ``` - + +--- + +# Not sure? + +Want to try it, but you're not sure? + +
+ +```shell +$ docker run --rm -it nixos/nix +``` + +
+ +```shell +$ podman run --rm -it nixos/nix +``` --- @@ -798,6 +883,5 @@ Phpactor 2025.03.28.0 - https://wiki.nixos.org/wiki/PHP - https://nixos.org/manual/nixpkgs/stable/#ssec-building-php-projects - https://code.oliverdavies.uk/opdavies/lab -- https://code.oliverdavies.uk/opdavies/drupal-nix-flake-example - https://code.oliverdavies.uk/opdavies/nix-config (laptop and home server) - https://books.oliverdavies.uk/nix-for-php-developers (book, in progress)