Last active
June 30, 2022 15:42
-
-
Save drupol/f35885baee1e1bf38caa1b7d69d5c244 to your computer and use it in GitHub Desktop.
flake.nix
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 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