Skip to content

Commit c57bd75

Browse files
committed
refactor: switch from numtide/flake-utils to flake-parts
1 parent edb094a commit c57bd75

File tree

2 files changed

+58
-62
lines changed

2 files changed

+58
-62
lines changed

flake.lock

Lines changed: 32 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,35 @@
22
description = "Repository of Nix expressions for old PHP versions";
33

44
inputs = {
5-
# Shim to make flake.nix work with stable Nix.
6-
flake-compat = {
7-
url = "github:edolstra/flake-compat";
8-
flake = false;
9-
};
10-
5+
flake-compat.url = "github:nix-community/flake-compat";
116
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
12-
13-
utils.url = "github:numtide/flake-utils";
7+
systems.url = "github:nix-systems/default";
148
};
159

16-
outputs = { self, flake-compat, nixpkgs, utils }:
17-
# For each supported platform,
18-
utils.lib.eachDefaultSystem (system:
19-
let
20-
# Let’s merge the package set from Nixpkgs with our custom PHP versions.
21-
pkgs = import nixpkgs.outPath {
22-
config = {
23-
allowUnfree = true;
24-
};
25-
inherit system;
26-
overlays = [
27-
self.overlays.default
28-
];
29-
};
30-
in rec {
31-
packages = {
32-
inherit (pkgs) php php56 php70 php71 php72 php73 php74 php80 php81 php82 php83;
33-
};
10+
outputs = inputs@{ self, flake-parts, nixpkgs, systems, ... }: flake-parts.lib.mkFlake { inherit inputs; } {
11+
systems = import systems;
12+
13+
perSystem = { self', inputs', config, pkgs, system, lib, ... }: {
14+
_module.args.pkgs = import self.inputs.nixpkgs {
15+
inherit system;
16+
overlays = [
17+
self.overlays.default
18+
];
19+
config.allowUnfree = true;
20+
};
3421

35-
checks = import ./checks.nix {
36-
inherit packages pkgs system;
37-
};
38-
}
39-
) // {
40-
overlays.default = import ./pkgs/phps.nix nixpkgs.outPath;
22+
packages = {
23+
inherit (pkgs) php php56 php70 php71 php72 php73 php74 php80 php81 php82 php83;
24+
};
25+
26+
checks = import ./checks.nix {
27+
inherit (self') packages;
28+
inherit pkgs system;
29+
};
30+
};
31+
32+
flake = {
33+
overlays.default = import ./pkgs/phps.nix nixpkgs;
4134
};
35+
};
4236
}

0 commit comments

Comments
 (0)