From 7818fdd6a5741d48f3c5bf09861df79cb775ab1b Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sun, 30 Jun 2024 14:36:48 +0200 Subject: [PATCH] add xdebug to flake --- Makefile | 3 ++- flake.nix | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 63c5ca6..4967860 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,8 @@ mocha: node_modules .PHONY: phpunit phpunit: - DB_PORT=5434 DB_TYPE=pgsql DB_HOST=localhost DB_USERNAME=postgres DB_USERNAME=postgres DB_PASSWORD=test DB_DATABASE=postgres ./vendor/bin/phpunit test + XDEBUG_CONFIG="idekey=PHPSTORM" XDEBUG_MODE=debug DB_PORT=5434 DB_TYPE=pgsql DB_HOST=localhost DB_USERNAME=postgres DB_USERNAME=postgres DB_PASSWORD=test DB_DATABASE=postgres \ + ./vendor/bin/phpunit test .PHONY: test tests: phpunit mocha diff --git a/flake.nix b/flake.nix index 5af0048..572dc81 100644 --- a/flake.nix +++ b/flake.nix @@ -29,6 +29,15 @@ LD=$CC ${pkgs.nodejs_20}/bin/node $@ ''; inherit (flocken.legacyPackages.${system}) mkDockerManifest; + + phpVersion = "php82"; + phpPackages = pkgs."${phpVersion}Packages"; + phpPackage = pkgs.${phpVersion}.buildEnv { + extraConfig = "memory_limit = 2G"; + extensions = ({ enabled, all }: enabled ++ (with all; [ + xdebug smbclient + ])); + }; in rec { packages = rec { inherit (pkgs) demostf-api demostf-api-docker demostf-parser; @@ -52,7 +61,7 @@ devShells.default = pkgs.mkShell { nativeBuildInputs = with pkgs; [ gnumake - php + phpPackage phpPackages.composer npmLd nodeLd