Add composer2nix to all PHP dev shells

This commit is contained in:
Oliver Davies 2025-08-15 17:04:14 +01:00
parent 63c58e5c4e
commit 3572510177
8 changed files with 40 additions and 10 deletions

View file

@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
- Add `php84` dev shell. - Add `php84` dev shell.
- Add `go` dev shell. - Add `go` dev shell.
- Add `composer2nix` to all PHP dev shells.
### Changed ### Changed

17
flake.lock generated
View file

@ -1,5 +1,21 @@
{ {
"nodes": { "nodes": {
"composer2nix": {
"flake": false,
"locked": {
"lastModified": 1646178110,
"narHash": "sha256-P3acfGwHYjjZQcviPiOT7T7qzzP/drc2mibzrsrNP18=",
"owner": "svanderburg",
"repo": "composer2nix",
"rev": "299caca4aac42d7639a42eb4dde951c010f6e91c",
"type": "github"
},
"original": {
"owner": "svanderburg",
"repo": "composer2nix",
"type": "github"
}
},
"devshell": { "devshell": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -89,6 +105,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"composer2nix": "composer2nix",
"devshell": "devshell", "devshell": "devshell",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"import-tree": "import-tree", "import-tree": "import-tree",

View file

@ -1,5 +1,8 @@
{ {
inputs = { inputs = {
composer2nix.flake = false;
composer2nix.url = "github:svanderburg/composer2nix";
devshell.inputs.nixpkgs.follows = "nixpkgs"; devshell.inputs.nixpkgs.follows = "nixpkgs";
devshell.url = "github:numtide/devshell"; devshell.url = "github:numtide/devshell";
@ -19,7 +22,16 @@
systems = [ "x86_64-linux" ]; systems = [ "x86_64-linux" ];
_module.args = { _module.args = {
commonPhpPackages = pkgs: with pkgs; [ phpactor ]; commonPhpPackages =
pkgs: system:
with pkgs;
let
composer2nix = import inputs.composer2nix { inherit system pkgs; };
in
[
composer2nix
phpactor
];
}; };
imports = [ imports = [

View file

@ -14,7 +14,7 @@
packages = [ packages = [
php php
phpPackages.composer phpPackages.composer
] ++ commonPhpPackages pkgs; ] ++ commonPhpPackages pkgs system;
shellHook = '' shellHook = ''
composer -V composer -V

View file

@ -2,13 +2,13 @@
{ {
perSystem = perSystem =
{ pkgs, ... }: { pkgs, system, ... }:
{ {
devShells.php81 = pkgs.mkShell { devShells.php81 = pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
php81 php81
php81Packages.composer php81Packages.composer
] ++ commonPhpPackages pkgs; ] ++ commonPhpPackages pkgs system;
shellHook = '' shellHook = ''
composer -V composer -V

View file

@ -2,13 +2,13 @@
{ {
perSystem = perSystem =
{ pkgs, ... }: { pkgs, system, ... }:
{ {
devShells.php82 = pkgs.mkShell { devShells.php82 = pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
php82 php82
php82Packages.composer php82Packages.composer
] ++ commonPhpPackages pkgs; ] ++ commonPhpPackages pkgs system;
shellHook = '' shellHook = ''
composer -V composer -V

View file

@ -2,13 +2,13 @@
{ {
perSystem = perSystem =
{ pkgs, ... }: { pkgs, system, ... }:
{ {
devShells.php83 = pkgs.mkShell { devShells.php83 = pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
php83 php83
php83Packages.composer php83Packages.composer
] ++ commonPhpPackages pkgs; ] ++ commonPhpPackages pkgs system;
shellHook = '' shellHook = ''
composer -V composer -V

View file

@ -2,13 +2,13 @@
{ {
perSystem = perSystem =
{ pkgs, ... }: { pkgs, system, ... }:
{ {
devShells.php84 = pkgs.mkShell { devShells.php84 = pkgs.mkShell {
packages = with pkgs; [ packages = with pkgs; [
php84 php84
php84Packages.composer php84Packages.composer
] ++ commonPhpPackages pkgs; ] ++ commonPhpPackages pkgs system;
shellHook = '' shellHook = ''
composer -V composer -V