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

View file

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

66
flake.lock generated
View file

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

View file

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

View file

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