summaryrefslogtreecommitdiff
path: root/2024/PHP/shell.nix
blob: 8b25fa11edbf1bf73ca900e3b5d8dbae59786ee9 (plain)
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
{ }:

let
  config = {
    allowUnfree = true;
  };
  pkgs = import <nixpkgs> { inherit config; };

  phpVersion = "php84";

  phpPackage = pkgs.lib.attrByPath [ phpVersion ] null pkgs;
  phpPackages = pkgs.lib.attrByPath [ "${phpVersion}Packages" ] null pkgs;
  phpExtensions = pkgs.lib.attrByPath [ "${phpVersion}Extensions" ] null pkgs;
in
pkgs.mkShell {
  # build tools
  nativeBuildInputs = with pkgs; [
    phpPackage
    nodejs_18
  ];
  # dependencies
  buildInputs = with pkgs; [
    intelephense
    phpunit
    phpPackages.php-cs-fixer
    phpPackages.phpstan
    phpExtensions.xdebug

    gh # GitHub CLI
  ];
}