1
1
Fork 0
mirror of https://github.com/the-nix-way/dev-templates synced 2024-05-19 05:06:21 +02:00

feat: add PHP environment

This commit is contained in:
Pol Dellaiera 2022-09-28 09:34:13 +02:00
parent b2377c6844
commit 28752cf318
5 changed files with 90 additions and 0 deletions

View File

@ -45,6 +45,7 @@ Once your preferred template has been initialized, you can use the provided shel
| [Node.js][node] | [`node`](./node/) |
| [OCaml] | [`ocaml`](./ocaml/) |
| [Open Policy Agent][opa] | [`opa`](./opa) |
| [PHP] | [`php`](./php/) |
| [Protobuf] | [`protobuf`](./protobuf/) |
| [Ruby] | [`ruby`](./ruby/) |
| [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
- [Conftest] 0.34.0
### [`php`](./php/)
- [PHP][php] 8.1.10
- [Composer][composer] 2.4.2
### [`protobuf`](./protobuf/)
- 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
[clippy]: https://github.com/rust-lang/rust-clippy
[clojure]: https://clojure.org
[composer]: https://getcomposer.org/
[conftest]: https://www.conftest.dev
[cross]: https://github.com/cross-rs/cross
[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
[pip]: https://pypi.org/project/pip
[phoenix]: https://phoenixframework.org
[php]: https://php.net/
[pnpm]: https://pnpm.io
[protobuf]: https://developers.google.com/protocol-buffers
[python]: https://python.org

View File

@ -85,6 +85,11 @@
description = "Open Policy Agent development environment";
};
php = {
path = ./php;
description = "PHP development environment";
};
protobuf = {
path = ./protobuf;
description = "Protobuf development environment";

1
php/.envrc Normal file
View File

@ -0,0 +1 @@
use flake .

42
php/flake.lock Normal file
View 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
View 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`"
'';
};
});
}