Last active
June 14, 2022 09:54
-
-
Save zopsicle/2254ce3b9e4f4c2b6318f17e26d94887 to your computer and use it in GitHub Desktop.
Nix shell for PHP development
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nix-shell --run 'composer install' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
tarball = fetchTarball { | |
url = "https://releases.nixos.org/nixpkgs/nixpkgs-22.05pre369766.3e242938104/nixexprs.tar.xz"; | |
sha256 = "1lk15ww5m4njd51286ypawpdrz25499sp01fhiil9byzjnp4xm0f"; | |
}; | |
in | |
import tarball { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
nixpkgs = import ./nixpkgs.nix; | |
# Configure which PHP version and extensions you want. | |
php = nixpkgs.php81.withExtensions phpExtensions; | |
phpExtensions = { all, ... }: [ | |
all.curl | |
all.filter | |
all.mbstring | |
all.openssl | |
]; | |
in | |
nixpkgs.mkShell { | |
nativeBuildInputs = [ | |
php | |
php.packages.composer | |
# Can also include other tools: | |
nixpkgs.cucumber # if using cucumber | |
nixpkgs.perl # if using prove | |
nixpkgs.firefox # if using firefox in CI for testing? idk | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment