initial version

This commit is contained in:
Robin Appelman 2025-10-25 15:23:20 +02:00
commit 1eceb2ce73
8 changed files with 428 additions and 0 deletions

54
flake.nix Normal file
View file

@ -0,0 +1,54 @@
# mill-scale -- A php module for flakelight
# Copyright (C) 2025 Robin Appelman <robin@icewind.nl>
# SPDX-License-Identifier: MIT
{
description = "A php module for flakelite";
inputs = {
nixpkgs.url = "nixpkgs/nixos-25.05";
flakelight = {
url = "github:nix-community/flakelight";
inputs.nixpkgs.follows = "nixpkgs";
};
phps = {
url = "github:fossar/nix-phps";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
flakelight,
phps,
...
}:
flakelight ./. {
imports = [flakelight.flakelightModules.extendFlakelight];
withOverlays = [phps.overlays.default];
formatters = pkgs:
with pkgs; {
"*.nix" = pkgs.lib.getExe alejandra;
};
flakelightModule = {lib, ...}: {
imports = [./flakelight-php.nix];
};
checks = {
nixTests = pkgs:
(import ./nix-tests.nix pkgs) (pkgs: let
composerMeta = pkgs.callPackage ./composer-meta.nix {
allVersions = ["7.3" "7.4" "8.0" "8.1" "8.2" "8.3" "8.4"];
};
in {
testPhpVersionsGt = {
expr = (composerMeta {require.php = ">=8.1";}).phpVersions;
expected = ["8.1" "8.2" "8.3" "8.4"];
};
testPhpVersionsAnd = {
expr = (composerMeta {require.php = ">8.0 <8.4";}).phpVersions;
expected = ["8.1" "8.2" "8.3"];
};
testPhpVersionsAndOr = {
expr = (composerMeta {require.php = ">8.0 <8.4 || =7.4";}).phpVersions;
expected = ["7.4" "8.1" "8.2" "8.3"];
};
});
};
};
}