From 06a7e9a85882151d1728c535af86fca5e928fca7 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 5 Aug 2025 01:58:31 +0100 Subject: [PATCH] Add marp lab --- marp/.envrc | 1 + marp/.gitignore | 2 + marp/flake.lock | 82 +++++++++++++++++++++++++++++++ marp/flake.nix | 24 +++++++++ marp/run | 3 ++ marp/slides.md | 126 ++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 238 insertions(+) create mode 100644 marp/.envrc create mode 100644 marp/.gitignore create mode 100644 marp/flake.lock create mode 100644 marp/flake.nix create mode 100755 marp/run create mode 100644 marp/slides.md diff --git a/marp/.envrc b/marp/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/marp/.envrc @@ -0,0 +1 @@ +use flake diff --git a/marp/.gitignore b/marp/.gitignore new file mode 100644 index 0000000..4b7e495 --- /dev/null +++ b/marp/.gitignore @@ -0,0 +1,2 @@ +/*.html +/.direnv/ diff --git a/marp/flake.lock b/marp/flake.lock new file mode 100644 index 0000000..20f5866 --- /dev/null +++ b/marp/flake.lock @@ -0,0 +1,82 @@ +{ + "nodes": { + "devshell": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1741473158, + "narHash": "sha256-kWNaq6wQUbUMlPgw8Y+9/9wP0F8SHkjy24/mN3UAppg=", + "owner": "numtide", + "repo": "devshell", + "rev": "7c9e793ebe66bcba8292989a68c0419b737a22a0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1754091436, + "narHash": "sha256-XKqDMN1/Qj1DKivQvscI4vmHfDfvYR2pfuFOJiCeewM=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "67df8c627c2c39c41dbec76a1f201929929ab0bd", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1754214453, + "narHash": "sha256-Q/I2xJn/j1wpkGhWkQnm20nShYnG7TI99foDBpXm1SY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5b09dc45f24cf32316283e62aec81ffee3c3e376", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1753579242, + "narHash": "sha256-zvaMGVn14/Zz8hnp4VWT9xVnhc8vuL3TStRqwk22biA=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "0f36c44e01a6129be94e3ade315a5883f0228a6e", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "devshell": "devshell", + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/marp/flake.nix b/marp/flake.nix new file mode 100644 index 0000000..18d9038 --- /dev/null +++ b/marp/flake.nix @@ -0,0 +1,24 @@ +{ + inputs = { + devshell.inputs.nixpkgs.follows = "nixpkgs"; + devshell.url = "github:numtide/devshell"; + flake-parts.url = "github:hercules-ci/flake-parts"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = + inputs: + inputs.flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ "x86_64-linux" ]; + + imports = [ inputs.devshell.flakeModule ]; + + perSystem = + { pkgs, ... }: + { + devshells.default = { + packages = [ pkgs.marp-cli ]; + }; + }; + }; +} diff --git a/marp/run b/marp/run new file mode 100755 index 0000000..02d31cf --- /dev/null +++ b/marp/run @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +marp slides.md --preview --watch diff --git a/marp/slides.md b/marp/slides.md new file mode 100644 index 0000000..593aeff --- /dev/null +++ b/marp/slides.md @@ -0,0 +1,126 @@ +--- +paginate: true +--- + + + +# Nix for PHP Developers + +
+ +### Oliver Davies + +https://www.oliverdavies.uk + +--- + +What is Nix? Nixpkgs? NixOS? + +--- + +Home Manager + +--- + +Nixvim + +--- + +Moved from Ansible + +--- + +How do people have PHP installed currently? + +--- + +# Who has project-specific versions of PHP? + +--- + +# search.nixos.org + + + +![center](nix-search.png) + +--- + +shell.nix + +--- + +Flakes + +--- + +devshells + +--- + +``` +nix run nixpkgs#php -- -v + +PHP 8.4.10 (cli) (built: Jul 2 2025 02:22:42) (NTS) +Copyright (c) The PHP Group +Zend Engine v4.4.10, Copyright (c) Zend Technologies + with Zend OPcache v8.4.10, Copyright (c), by Zend Technologies +``` + +``` +nix run nixpkgs#php83 -- -v + +PHP 8.3.23 (cli) (built: Jul 1 2025 16:52:12) (NTS) +Copyright (c) The PHP Group +Zend Engine v4.3.23, Copyright (c) Zend Technologies + with Zend OPcache v8.3.23, Copyright (c), by Zend Technologies +``` + +--- + +``` +nix develop github:opdavies/dev-shells#php82 -c composer -V + +PHP 8.2.28 (cli) (built: Mar 11 2025 17:58:12) (NTS) +Copyright (c) The PHP Group +Zend Engine v4.2.28, Copyright (c) Zend Technologies + with Zend OPcache v8.2.28, Copyright (c), by Zend Technologies +Composer version 2.8.5 2025-01-21 15:23:40 +``` + +``` +nix develop github:opdavies/dev-shells#php83 -c composer -V + +PHP 8.3.22 (cli) (built: Jun 3 2025 17:17:57) (NTS) +Copyright (c) The PHP Group +Zend Engine v4.3.22, Copyright (c) Zend Technologies + with Zend OPcache v8.3.22, Copyright (c), by Zend Technologies +Composer version 2.8.5 2025-01-21 15:23:40 +``` + +--- + +Services.flake + +--- + +# Thanks + +- https://www.oliverdavies.uk/nix-php-developers +- https://www.oliverdavies.uk/presentations +- https://www.oliverdavies.uk/daily +- https://www.oliverdavies.uk/podcast