This commit is contained in:
Robin Appelman 2026-08-31 16:48:10 +02:00
commit 64ed2da575
5 changed files with 36 additions and 56 deletions

View file

@ -1,6 +1,7 @@
{
composerMeta,
src,
phpstan,
php,
vendor,
stdenvNoCC,
@ -11,7 +12,11 @@ in
inherit src version;
pname = "${name}-phpstan-${php.version}";
nativeBuildInputs = [php.packages.phpstan];
nativeBuildInputs = [
(phpstan.override {
inherit php;
})
];
postPatch = ''
ln -s ${vendor}/vendor vendor

View file

@ -1,6 +1,7 @@
{
composerMeta,
src,
psalm,
php,
vendor,
stdenvNoCC,
@ -11,7 +12,11 @@ in
inherit src version;
pname = "${name}-psalm-${php.version}";
nativeBuildInputs = [php.packages.psalm];
nativeBuildInputs = [
(psalm.override {
inherit php;
})
];
postPatch = ''
ln -s ${vendor}/vendor vendor

66
flake.lock generated
View file

@ -3,15 +3,15 @@
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"lastModified": 1767039857,
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
"owner": "NixOS",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
"type": "github"
},
"original": {
"owner": "edolstra",
"owner": "NixOS",
"repo": "flake-compat",
"type": "github"
}
@ -23,11 +23,11 @@
]
},
"locked": {
"lastModified": 1756730985,
"narHash": "sha256-Uv5lLUZfFxQv6RHi1TqLTKso0j0eUVMQQwud29LTV/s=",
"lastModified": 1787576251,
"narHash": "sha256-F3Giew387kwGw1r4IR9AdFifxOORRBHEHwsCEevnV/g=",
"owner": "nix-community",
"repo": "flakelight",
"rev": "950121d809b75c32e73684b32ccba8d4e8a67703",
"rev": "4d9eabe93ff4d73cc195a0e8dec0f3fbac31c226",
"type": "github"
},
"original": {
@ -38,16 +38,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1761173472,
"narHash": "sha256-m9W0dYXflzeGgKNravKJvTMR4Qqa2MVD11AwlGMufeE=",
"lastModified": 1787962033,
"narHash": "sha256-u6z9VTZA4Kf3RkHQo9sQI7NI4Ei/uiU9vrMqOiwWP1Y=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c8aa8cc00a5cb57fada0851a038d35c08a36a2bb",
"rev": "c5c4a43b0e8056328ec4529f735cabdb8f1942bb",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-25.05",
"ref": "nixos-26.05",
"type": "indirect"
}
},
@ -56,15 +56,14 @@
"flake-compat": "flake-compat",
"nixpkgs": [
"nixpkgs"
],
"utils": "utils"
]
},
"locked": {
"lastModified": 1760894074,
"narHash": "sha256-z2EYR3CA5PWTkUr5WkDni2CZQ326msHLPghJLx11pZ0=",
"lastModified": 1787488799,
"narHash": "sha256-bTvBlBOTWDufCKgc7kfC+h2xvBJIQUNpg0cK1fj73kc=",
"owner": "fossar",
"repo": "nix-phps",
"rev": "d2807871f18ab2150b1e46b7ee126fe0bf200d4c",
"rev": "32c4df436bd1a7ff528ab3014bd51dd837d5a862",
"type": "github"
},
"original": {
@ -79,39 +78,6 @@
"nixpkgs": "nixpkgs",
"phps": "phps"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",

View file

@ -4,7 +4,7 @@
{
description = "A php module for flakelite";
inputs = {
nixpkgs.url = "nixpkgs/nixos-25.05";
nixpkgs.url = "nixpkgs/nixos-26.05";
flakelight = {
url = "github:nix-community/flakelight";
inputs.nixpkgs.follows = "nixpkgs";

View file

@ -121,7 +121,9 @@ in
config = mkMerge [
(mkIf (pathExists config.composerJson) {
withOverlays = [
(final: prev: {
(final: prev: let
withMinPhp = pkg: pkg.override {php = final.minPhp;};
in {
minPhp = buildPhp final;
vendor = final.callPackage ./pkgs/vendor.nix {
php = final.minPhp;
@ -134,8 +136,10 @@ in
testDependencies = config.testDependencies final;
};
phpstan = withMinPhp prev.phpstan;
inherit composerMeta filteredSrc;
inherit (final.minPhp.packages) php-cs-fixer composer psalm phpstan;
inherit (final.minPhp.packages) php-cs-fixer composer psalm;
})
];
@ -159,7 +163,7 @@ in
forPhpVersions = name: checkFile:
genAttrs' composerMeta.phpVersions (version: {
name = "${name}${removeDots version}";
value = pkgs.callPackage ./checks/psalm.nix {
value = pkgs.callPackage checkFile {
src = filteredSrc;
php = buildPhpVersion pkgs version;
};