Skip to content

Instantly share code, notes, and snippets.

@drupol
Last active June 30, 2022 15:42
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/f35885baee1e1bf38caa1b7d69d5c244 to your computer and use it in GitHub Desktop.
Save drupol/f35885baee1e1bf38caa1b7d69d5c244 to your computer and use it in GitHub Desktop.
flake.nix
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-utils.inputs.nixpkgs.follows = "nixpkgs";
nix-shell.url = "/home/devlin/Code/loophp/nix-shell";
};
outputs = { self, nixpkgs, flake-utils, nix-shell }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs {
inherit system;
};
phpDev = (nix-shell.api.makePhp system {
php = "php74";
withExtensions = [ "pcov" "xdebug" ];
extraConfig = ''
memory_limit=-1
'';
flags = {
apxs2Support = false;
ztsSupport = false;
};
});
phpProd = (nix-shell.api.makePhp system {
php = "php81";
extraConfig = ''
memory_limit=-1
'';
flags = {
apxs2Support = false;
ztsSupport = false;
};
});
in
{
devShells = {
dev = pkgs.mkShellNoCC {
name = "Hope project";
buildInputs = [
phpDev
phpDev.packages.composer
pkgs.mailhog
];
};
prod = pkgs.mkShellNoCC {
name = "Hope project";
buildInputs = [
phpProd
phpProd.packages.composer
pkgs.mailhog
];
};
};
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment