-
-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathshell.nix
More file actions
57 lines (51 loc) · 1.24 KB
/
shell.nix
File metadata and controls
57 lines (51 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
let
nixpkgs = fetchTarball {
# Oct 31, 2025
url = "https://github.com/NixOS/nixpkgs/archive/66a437ebcf6160152336e801a7ec289ba2aba3c5.tar.gz";
};
lockedPkgs = import nixpkgs {
config = {
allowUnfree = true;
};
};
in
{
pkgs ? lockedPkgs,
php-version ? 8.3,
with-blackfire ? false,
with-xdebug ? false,
with-pcov ? !with-blackfire
}:
let
base-php = if php-version == 8.3 then
pkgs.php83
else if php-version == 8.4 then
pkgs.php84
else
throw "Unknown php version ${php-version}";
php = pkgs.callPackage ./.nix/pkgs/php/package.nix {
php = base-php;
inherit with-pcov with-xdebug with-blackfire;
};
in
pkgs.mkShell {
buildInputs = [
php
php.packages.composer
pkgs.starship
pkgs.figlet
pkgs.act
]
++ pkgs.lib.optional with-blackfire pkgs.blackfire
;
shellHook = ''
if [ -f "$PWD/.nix/shell/starship.toml" ]; then
export STARSHIP_CONFIG="$PWD/.nix/shell/starship.toml"
else
export STARSHIP_CONFIG="$PWD/.nix/shell/starship.toml.dist"
fi
eval "$(${pkgs.starship}/bin/starship init bash)"
clear
figlet "PHP Matcher"
'';
}