dev-templates/php/flake.nix

35 lines
700 B
Nix
Raw Normal View History

2022-09-28 00:34:13 -07:00
{
description = "A Nix-flake-based PHP development environment";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs =
{ self
, flake-utils
, nixpkgs
}:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [
(self: super: rec {
php = super.php;
composer = super.phpPackages.composer;
})
];
pkgs = import nixpkgs { inherit overlays system; };
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ composer php ];
shellHook = ''
echo "`${pkgs.php}/bin/php --version`"
'';
};
});
}