Skip to content

Commit 6419de2

Browse files
committed
Add flake for PHP 8.4
1 parent 6a1a057 commit 6419de2

File tree

2 files changed

+117
-0
lines changed

2 files changed

+117
-0
lines changed

flake.lock

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# this is a WIP flake for development and experimentation only
2+
{
3+
description = "phpactor/phpactor";
4+
5+
inputs = {
6+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
7+
};
8+
9+
outputs = inputs @ {
10+
self,
11+
flake-parts,
12+
...
13+
}:
14+
flake-parts.lib.mkFlake {inherit inputs;} {
15+
# This flake is for Linux (x86) and Apple (darwin) systems
16+
# If you need more systems, inspect `nixpkgs.lib.systems.flakeExposed` and
17+
# add them to this list.
18+
#
19+
# $ nix repl "<nixpkgs>"
20+
# nix-repl> lib.systems.flakeExposed
21+
systems = ["x86_64-linux" "aarch64-linux"];
22+
23+
perSystem = {
24+
pkgs,
25+
system,
26+
...
27+
}: let
28+
phpWithXdebug = (pkgs.php84.buildEnv {
29+
extensions = ({ enabled, all }: enabled ++ (with all; [
30+
xdebug
31+
]));
32+
extraConfig = ''
33+
xdebug.mode=debug
34+
'';
35+
});
36+
in {
37+
# Run `nix fmt` to reformat the nix files
38+
formatter = pkgs.alejandra;
39+
40+
# Run `nix develop` to enter the development shell
41+
devShells.default = pkgs.mkShellNoCC {
42+
name = "php-devshell";
43+
44+
buildInputs = [
45+
phpWithXdebug
46+
pkgs.php84.packages.composer
47+
];
48+
shellHook = ''
49+
if [ ! -d ".venv" ]; then
50+
python3 -m venv .venv;
51+
fi
52+
source .venv/bin/activate;'';
53+
};
54+
};
55+
};
56+
}
57+

0 commit comments

Comments
 (0)