Skip to content

Instantly share code, notes, and snippets.

@drupol
Last active September 14, 2022 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drupol/64e17dcab29b9e4270a91fef08d78a9a to your computer and use it in GitHub Desktop.
Save drupol/64e17dcab29b9e4270a91fef08d78a9a to your computer and use it in GitHub Desktop.
Basic flake for PHP development
{
description = "A PHP development environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
};
php = pkgs.php.buildEnv {
extensions = ({ enabled, all }: enabled ++ (with all; [
oci8
]));
extraConfig = ''
memory_limit=-1
'';
};
packages = [
php
php.packages.composer
pkgs.vscode
pkgs.symfony-cli
];
in
{
# nix shell
packages = {
default = pkgs.buildEnv {
name = "devShellPHP";
paths = packages;
};
};
# nix develop, direnv
devShells = {
default = pkgs.mkShellNoCC {
name = "devShellPHP";
buildInputs = packages;
};
};
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment