Last active
September 14, 2022 11:56
-
-
Save drupol/64e17dcab29b9e4270a91fef08d78a9a to your computer and use it in GitHub Desktop.
Basic flake for PHP development
This file contains 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
{ | |
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