Created
March 22, 2024 10:36
-
-
Save drupol/488fb532e3e4c925ccb7e9ab294b27ec 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
{ | |
inputs = { | |
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | |
systems.url = "github:nix-systems/default"; | |
}; | |
outputs = inputs @ { self, flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { | |
systems = import inputs.systems; | |
perSystem = { config, self', inputs', pkgs, system, lib, ... }: let | |
scriptPhp81 = pkgs.writeShellApplication { | |
name = "run-tests-with-php81"; | |
runtimeInputs = [ | |
(pkgs.php81.withExtensions ({ enabled, all }: enabled ++ [ all.imagick ])) | |
pkgs.phpPackages.composer | |
pkgs.phpunit | |
]; | |
text = '' | |
composer install | |
phpunit | |
''; | |
}; | |
scriptPhp82 = pkgs.writeShellApplication { | |
name = "run-tests-with-php82"; | |
runtimeInputs = [ | |
pkgs.php82 | |
pkgs.phpPackages.composer | |
]; | |
text = '' | |
composer install | |
php --version | |
''; | |
}; | |
in { | |
devShells.default = pkgs.mkShell { | |
name = "collection-dev-env"; | |
packages = [ | |
scriptPhp81 | |
scriptPhp82 | |
pkgs.phpunit | |
]; | |
}; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment