Merge pull request #5 from drupol/php/add-php-dev-environment
feat: add PHP environment
This commit is contained in:
commit
f89d066e0c
|
@ -45,6 +45,7 @@ Once your preferred template has been initialized, you can use the provided shel
|
||||||
| [Node.js][node] | [`node`](./node/) |
|
| [Node.js][node] | [`node`](./node/) |
|
||||||
| [OCaml] | [`ocaml`](./ocaml/) |
|
| [OCaml] | [`ocaml`](./ocaml/) |
|
||||||
| [Open Policy Agent][opa] | [`opa`](./opa) |
|
| [Open Policy Agent][opa] | [`opa`](./opa) |
|
||||||
|
| [PHP] | [`php`](./php/) |
|
||||||
| [Protobuf] | [`protobuf`](./protobuf/) |
|
| [Protobuf] | [`protobuf`](./protobuf/) |
|
||||||
| [Ruby] | [`ruby`](./ruby/) |
|
| [Ruby] | [`ruby`](./ruby/) |
|
||||||
| [Rust] | [`rust`](./rust/) |
|
| [Rust] | [`rust`](./rust/) |
|
||||||
|
@ -170,6 +171,11 @@ The sections below list what each template includes. In all cases, you're free t
|
||||||
- [Open Policy Agent][opa] 0.43.0
|
- [Open Policy Agent][opa] 0.43.0
|
||||||
- [Conftest] 0.34.0
|
- [Conftest] 0.34.0
|
||||||
|
|
||||||
|
### [`php`](./php/)
|
||||||
|
|
||||||
|
- [PHP][php] 8.1.10
|
||||||
|
- [Composer][composer] 2.4.2
|
||||||
|
|
||||||
### [`protobuf`](./protobuf/)
|
### [`protobuf`](./protobuf/)
|
||||||
|
|
||||||
- The [Buf CLI][buf] 1.7.0
|
- The [Buf CLI][buf] 1.7.0
|
||||||
|
@ -222,6 +228,7 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T
|
||||||
[cargo-deny]: https://crates.io/crates/cargo-deny
|
[cargo-deny]: https://crates.io/crates/cargo-deny
|
||||||
[clippy]: https://github.com/rust-lang/rust-clippy
|
[clippy]: https://github.com/rust-lang/rust-clippy
|
||||||
[clojure]: https://clojure.org
|
[clojure]: https://clojure.org
|
||||||
|
[composer]: https://getcomposer.org/
|
||||||
[conftest]: https://www.conftest.dev
|
[conftest]: https://www.conftest.dev
|
||||||
[cross]: https://github.com/cross-rs/cross
|
[cross]: https://github.com/cross-rs/cross
|
||||||
[cue]: https://cuelang.org
|
[cue]: https://cuelang.org
|
||||||
|
@ -284,6 +291,7 @@ All of the templates have only the root [flake](./flake.nix) as a flake input. T
|
||||||
[packer]: https://packer.io
|
[packer]: https://packer.io
|
||||||
[pip]: https://pypi.org/project/pip
|
[pip]: https://pypi.org/project/pip
|
||||||
[phoenix]: https://phoenixframework.org
|
[phoenix]: https://phoenixframework.org
|
||||||
|
[php]: https://php.net/
|
||||||
[pnpm]: https://pnpm.io
|
[pnpm]: https://pnpm.io
|
||||||
[protobuf]: https://developers.google.com/protocol-buffers
|
[protobuf]: https://developers.google.com/protocol-buffers
|
||||||
[python]: https://python.org
|
[python]: https://python.org
|
||||||
|
|
|
@ -90,6 +90,11 @@
|
||||||
description = "Open Policy Agent development environment";
|
description = "Open Policy Agent development environment";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
php = {
|
||||||
|
path = ./php;
|
||||||
|
description = "PHP development environment";
|
||||||
|
};
|
||||||
|
|
||||||
protobuf = {
|
protobuf = {
|
||||||
path = ./protobuf;
|
path = ./protobuf;
|
||||||
description = "Protobuf development environment";
|
description = "Protobuf development environment";
|
||||||
|
|
1
php/.envrc
Normal file
1
php/.envrc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
use flake .
|
42
php/flake.lock
Normal file
42
php/flake.lock
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"flake-utils": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1659877975,
|
||||||
|
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1664349153,
|
||||||
|
"narHash": "sha256-F6ZAHd9qR2lp49L1NiBFZ1NVJdTne56+dkI62glOj/w=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "467132e5ab10f122fbe313ebcc31eeaca65fae42",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
34
php/flake.nix
Normal file
34
php/flake.nix
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
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`"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in a new issue