Skip to content

Commit 3e10d88

Browse files
committed
Provide currently supported PHP binaries in shell
1 parent afe71fe commit 3e10d88

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

flake.nix

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,19 @@
99
outputs = { self, nixpkgs, flake-utils, ... }:
1010
flake-utils.lib.eachDefaultSystem (system:
1111
with import nixpkgs { inherit system; };
12-
with pkgs; {
12+
with pkgs;
13+
let
14+
phpVersions = {
15+
php81 = php81;
16+
php82 = php82;
17+
php83 = php83;
18+
php84 = php84;
19+
};
20+
phpBins = lib.attrsets.mapAttrsToList (name: phpPkg:
21+
pkgs.writeShellScriptBin name ''${phpPkg}/bin/php "$@"'') phpVersions;
22+
in {
1323
devShells.default = mkShell {
14-
buildInputs = [ php phpPackages.composer shellcheck zip ];
24+
buildInputs = [ php phpPackages.composer shellcheck zip ] ++ phpBins;
1525
};
1626
});
1727
}

0 commit comments

Comments
 (0)