Streamline shell.nix

This commit is contained in:
Daniel Siepmann 2024-03-05 19:39:12 +01:00
parent b396925dda
commit 119395a48c
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4

View file

@ -1,11 +1,26 @@
{ pkgs ? import <nixpkgs> { } }:
{
pkgs ? import <nixpkgs> { }
,phps ? import <phps>
}:
let
php = phps.packages.x86_64-linux.php83.buildEnv {
extensions = { enabled, all }: enabled ++ (with all; [
xdebug
]);
extraConfig = ''
xdebug.mode = debug
memory_limit = 4G
'';
};
inherit(php.packages) composer;
projectInstall = pkgs.writeShellApplication {
name = "project-install";
runtimeInputs = [
pkgs.php83
pkgs.php83Packages.composer
php
composer
projectTest
];
text = ''
@ -16,7 +31,7 @@ let
projectTest = pkgs.writeShellApplication {
name = "project-test";
runtimeInputs = [
pkgs.php83
php
];
text = ''
./vendor/bin/phpunit
@ -26,7 +41,7 @@ let
projectRun = pkgs.writeShellApplication {
name = "project-run";
runtimeInputs = [
pkgs.php83
php
];
text = ''
php -S 127.0.0.1:8080 -t public
@ -38,8 +53,8 @@ let
pkgs.git
pkgs.rsync
# Missing ssh
pkgs.php83
pkgs.php83Packages.composer
php
composer
projectInstall
];
text = ''
@ -71,8 +86,8 @@ let
in pkgs.mkShellNoCC {
name = "Fediverse-Feed-Wrappers";
buildInputs = [
pkgs.php83
pkgs.php83Packages.composer
php
composer
projectInstall
projectTest
projectRun