diff --git a/flake.lock b/flake.lock index 52811244..70d6c798 100644 --- a/flake.lock +++ b/flake.lock @@ -16,6 +16,23 @@ "type": "github" } }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1675933616, + "narHash": "sha256-/rczJkJHtx16IFxMmAWu5nNYcSXNg1YYXTHoGjLrLUA=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "47478a4a003e745402acf63be7f9a092d51b83d7", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, "nixpkgs": { "locked": { "lastModified": 1704842529, @@ -32,44 +49,29 @@ "type": "github" } }, - "root": { - "inputs": { - "flake-compat": "flake-compat", - "nixpkgs": "nixpkgs", - "utils": "utils" - } - }, - "systems": { + "nixpkgs-lib": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "dir": "lib", + "lastModified": 1675183161, + "narHash": "sha256-Zq8sNgAxDckpn7tJo7V1afRSk2eoVbu3OjI1QklGLNg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e1e1b192c1a5aab2960bf0a0bd53a2e8124fa18e", "type": "github" }, "original": { - "owner": "nix-systems", - "repo": "default", + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", "type": "github" } }, - "utils": { + "root": { "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" } } }, diff --git a/flake.nix b/flake.nix index c55dac3f..cb873879 100644 --- a/flake.nix +++ b/flake.nix @@ -2,41 +2,35 @@ description = "Repository of Nix expressions for old PHP versions"; inputs = { - # Shim to make flake.nix work with stable Nix. - flake-compat = { - url = "github:edolstra/flake-compat"; - flake = false; - }; - + flake-compat.url = "github:nix-community/flake-compat"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - - utils.url = "github:numtide/flake-utils"; + systems.url = "github:nix-systems/default"; }; - outputs = { self, flake-compat, nixpkgs, utils }: - # For each supported platform, - utils.lib.eachDefaultSystem (system: - let - # Let’s merge the package set from Nixpkgs with our custom PHP versions. - pkgs = import nixpkgs.outPath { - config = { - allowUnfree = true; - }; - inherit system; - overlays = [ - self.overlays.default - ]; - }; - in rec { - packages = { - inherit (pkgs) php php56 php70 php71 php72 php73 php74 php80 php81 php82 php83; - }; + outputs = inputs@{ self, flake-parts, nixpkgs, systems, ... }: flake-parts.lib.mkFlake { inherit inputs; } { + systems = import systems; + + perSystem = { self', inputs', config, pkgs, system, lib, ... }: { + _module.args.pkgs = import self.inputs.nixpkgs { + inherit system; + overlays = [ + self.overlays.default + ]; + config.allowUnfree = true; + }; - checks = import ./checks.nix { - inherit packages pkgs system; - }; - } - ) // { - overlays.default = import ./pkgs/phps.nix nixpkgs.outPath; + packages = { + inherit (pkgs) php php56 php70 php71 php72 php73 php74 php80 php81 php82 php83; + }; + + checks = import ./checks.nix { + inherit (self') packages; + inherit pkgs system; + }; + }; + + flake = { + overlays.default = import ./pkgs/phps.nix nixpkgs; }; + }; }